View Javadoc

1   /*
2    * $Id$
3    * 
4    * Created on 26 Jan 2010 by Paul Harrison (paul.harrison@manchester.ac.uk)
5    *
6    * Adapted from official SOFA C implementation http://www.iausofa.org/
7    */ 
8   
9   package org.jastronomy.jsofa;
10  
11  import static java.lang.Math.cos;
12  import static java.lang.Math.sin;
13  import static java.lang.Math.atan;
14  import static java.lang.Math.atan2;
15  import static java.lang.Math.min;
16  import static java.lang.Math.max;
17  import static java.lang.Math.ceil;
18  import static java.lang.Math.floor;
19  import static java.lang.Math.sqrt;
20  import static java.lang.Math.abs;
21  import static java.lang.Math.pow;
22  
23  
24  
25  
26  
27  
28  
29  
30  /**
31   * Java implementation of Standards of Fundamental Astronomy. <a href="http://www.iausofa.org/">http://www.iausofa.org/</a>
32   * 
33   * This code has been created by hand translating the official C version.
34   * 
35   * @author Paul Harrison (paul.harrison@manchester.ac.uk) 02 Apr 2014
36   * @version JSOFA Release 20180130
37   * @since 26 Jan 2010
38   */
39  public class JSOFA {
40      /** tracked IAU SOFA release {@value}. */
41      public final static String SOFA_RELEASE = "2023-10-11";
42      
43      /** JSOFA release {@value}*/
44      public final static String JSOFA_RELEASE = "20231011";
45  
46      /** tracked IAU SOFA revision {@value}. */
47      public final static String SOFA_REVISION = "19";
48  
49      /** Release year for this version of jauDat {@value} */
50  public final static int IYV = 2023;
51      /** The latest confirmed omission of a leap second form IERS */
52  public final static JulianDate latestConfirmedNoLeapSecondChange = jauCal2jd(2026,01,28);
53  
54  static class LeapInfo {
55      final public int iyear, month;
56      final public double delat;
57      public LeapInfo(int i, int m, double t) {
58         iyear = i;
59         month = m;
60         delat = t;
61      }
62   }
63  
64  /* Dates and Delta(AT)s */
65  static final LeapInfo leapSeconds[] = {
66       new LeapInfo( 1960,  1,  1.4178180 ),
67       new LeapInfo( 1961,  1,  1.4228180 ),
68       new LeapInfo( 1961,  8,  1.3728180 ),
69       new LeapInfo( 1962,  1,  1.8458580 ),
70       new LeapInfo( 1963, 11,  1.9458580 ),
71       new LeapInfo( 1964,  1,  3.2401300 ),
72       new LeapInfo( 1964,  4,  3.3401300 ),
73       new LeapInfo( 1964,  9,  3.4401300 ),
74       new LeapInfo( 1965,  1,  3.5401300 ),
75       new LeapInfo( 1965,  3,  3.6401300 ),
76       new LeapInfo( 1965,  7,  3.7401300 ),
77       new LeapInfo( 1965,  9,  3.8401300 ),
78       new LeapInfo( 1966,  1,  4.3131700 ),
79       new LeapInfo( 1968,  2,  4.2131700 ),
80       new LeapInfo( 1972,  1, 10.0       ),
81       new LeapInfo( 1972,  7, 11.0       ),
82       new LeapInfo( 1973,  1, 12.0       ),
83       new LeapInfo( 1974,  1, 13.0       ),
84       new LeapInfo( 1975,  1, 14.0       ),
85       new LeapInfo( 1976,  1, 15.0       ),
86       new LeapInfo( 1977,  1, 16.0       ),
87       new LeapInfo( 1978,  1, 17.0       ),
88       new LeapInfo( 1979,  1, 18.0       ),
89       new LeapInfo( 1980,  1, 19.0       ),
90       new LeapInfo( 1981,  7, 20.0       ),
91       new LeapInfo( 1982,  7, 21.0       ),
92       new LeapInfo( 1983,  7, 22.0       ),
93       new LeapInfo( 1985,  7, 23.0       ),
94       new LeapInfo( 1988,  1, 24.0       ),
95       new LeapInfo( 1990,  1, 25.0       ),
96       new LeapInfo( 1991,  1, 26.0       ),
97       new LeapInfo( 1992,  7, 27.0       ),
98       new LeapInfo( 1993,  7, 28.0       ),
99       new LeapInfo( 1994,  7, 29.0       ),
100      new LeapInfo( 1996,  1, 30.0       ),
101      new LeapInfo( 1997,  7, 31.0       ),
102      new LeapInfo( 1999,  1, 32.0       ),
103      new LeapInfo( 2006,  1, 33.0       ),
104      new LeapInfo( 2009,  1, 34.0       ),
105      new LeapInfo( 2012,  7, 35.0       ),
106      new LeapInfo( 2015,  7, 36.0       ),
107      new LeapInfo( 2017,  1, 37.0       )
108   };
109 
110 
111     /** Seconds of time to radians {@value} */
112     public final static double DS2R = (7.272205216643039903848712e-5);
113 
114     /** Pi {@value}*/
115     public final static double DPI = (3.141592653589793238462643);
116 
117     /** 2Pi {@value}*/
118     public final static double D2PI = (6.283185307179586476925287);
119 
120     /** Radians to degrees {@value} */
121     public final static double DR2D = (57.29577951308232087679815);
122 
123     /** Degrees to radians {@value}*/
124     public final static double DD2R = (1.745329251994329576923691e-2);
125 
126     /** Radians to arcseconds {@value}*/
127     public final static double DR2AS = (206264.8062470963551564734);
128 
129     /** Arcseconds to radians {@value}*/
130     public final static double DAS2R = (4.848136811095359935899141e-6);
131 
132     /** Arcseconds in a full circle {@value}*/
133     public final static double TURNAS = (1296000.0);
134 
135     /** Milliarcseconds to radians {@value}*/
136     public final static double DMAS2R = (DAS2R / 1e3);
137 
138     /** Length of tropical year B1900 (days) {@value}*/
139     public final static double DTY = (365.242198781);
140 
141     /** Reference epoch (J2000.0), Julian Date {@value}*/
142     public final static double DJ00 = (2451545.0);
143 
144     /** Julian Date of Modified Julian Date zero {@value}*/
145     public final static double DJM0 = (2400000.5);
146 
147     /** Reference epoch (J2000.0), Modified Julian Date {@value} */
148     public final static double DJM00 = (51544.5);
149 
150     /** Seconds per day. {@value}*/
151     public final static double DAYSEC = (86400.0);
152 
153     /** Days per Julian year */
154     public final static double DJY = (365.25);
155 
156     /** Days per Julian century {@value} */
157     public final static double DJC = (36525.0);
158 
159     /** Days per Julian millennium {@value} */
160     public final static double DJM = (365250.0);
161     
162     /** 1977 Jan 1.0 as MJD */
163     public final static double DJM77 = (43144.0);
164 
165     /** TT minus TAI (s) */
166     public final static double TTMTAI = (32.184);
167 
168 
169     /**  Astronomical unit (m) IAU 2012 {@value} */
170     public final static double DAU = (149597870.7e3);
171     
172     /** Speed of light (m/s) {@value} */
173     public final static double CMPS = 299792458.0;
174 
175     /** Light time for 1 au (s) {@value} */
176     public final static double AULT = (DAU/CMPS);
177 
178 
179     /** Speed of light (au per day) {@value} */
180     public final static double DC = (DAYSEC / AULT);
181     
182     /** L_G = 1 - d(TT)/d(TCG) */
183     public final static double ELG = (6.969290134e-10);
184 
185     /** L_B = 1 - d(TDB)/d(TCB) at TAI 1977/1/1.0 */
186     public final static double ELB = (1.550519768e-8);
187     
188     /** Schwarzschild radius of the Sun (au) {@value}
189      = 2 * 1.32712440041e20 / (2.99792458e8)^2 / 1.49597870700e11 */
190     public final static double SRS = 1.97412574336e-8;
191 
192     
193     /** TDB (s) at TAI 1977/1/1.0 */
194     public final static double TDB0 = (-6.55e-5);
195 
196     private final static double TANGENT_TINY = 1e-6;
197 
198     private static final double DBL_EPSILON = Math.ulp(1.0);
199 
200     /** dint(A) - truncate to nearest whole number towards zero (double)  */
201     private static double dint(final double A){ return ((A)<0.0?ceil(A):floor(A));}
202 
203     /** dnint(A) - round to nearest whole number (double)  */
204     private static double dnint(final double A){return (abs(A)<0.5?0.0
205                                 :((A)<0.0?ceil((A)-0.5):floor((A)+0.5)));}
206 
207     /** dsign(A,B) - magnitude of A with sign of B (double) */
208     private static double dsign(final double A, double B){return ((B)<0.0?-abs(A):abs(A));}
209 
210      
211     
212     /**
213      * Julian Date representation. The actual date is djm0+djm1, apportioned in any
214      *     convenient way between the two arguments.  For example,
215      *     JD(TT)=2450123.7 could be expressed in any of these ways,
216      *     among others:
217      *<pre>
218      *            djm0          djm1
219      *
220      *         2450123.7           0.0       (JD method)
221      *         2451545.0       -1421.3       (J2000 method)
222      *         2400000.5       50123.2       (MJD method)
223      *         2450123.5           0.2       (date &amp;time method)
224      *</pre>
225      * 
226      * The JD method is the most natural and convenient to use in
227      *     cases where the loss of several decimal digits of resolution
228      *     is acceptable.  The J2000 method is best matched to the way
229      *     the argument is handled internally and will deliver the
230      *     optimum resolution.  The MJD method and the date &amp;time methods
231      *     are both good compromises between resolution and convenience.
232      * 
233      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Jan 2010
234      * 
235      * 
236      */
237     public static class JulianDate implements Comparable<JulianDate>{
238         /**  MJD zero-point */
239         public double djm0;  
240         /** MJD offset */
241         public double djm1;
242         public JulianDate(double d1, double d2) {
243             djm0 = d1;
244             djm1 = d2;
245         }
246         /**
247          * {@inheritDoc}
248          * overrides @see java.lang.Comparable#compareTo(java.lang.Object)
249          */
250         @Override
251         public int compareTo(JulianDate o) {
252             if(this == o) return 0;
253             final Double thismjd = this.djm0 + this.djm1;
254             final Double thatmjd = o.djm0 + o.djm1;
255 
256             return thismjd.compareTo(thatmjd);
257         }
258         /**
259          * {@inheritDoc}
260          * overrides @see java.lang.Object#hashCode()
261          */
262         @Override
263         public int hashCode() {
264             final int prime = 31;
265             int result = 1;
266             long temp;
267             temp = Double.doubleToLongBits(djm0);
268             result = prime * result + (int) (temp ^ (temp >>> 32));
269             temp = Double.doubleToLongBits(djm1);
270             result = prime * result + (int) (temp ^ (temp >>> 32));
271             return result;
272         }
273         /**
274          * {@inheritDoc}
275          * overrides @see java.lang.Object#equals(java.lang.Object)
276          */
277         @Override
278         public boolean equals(Object obj) {
279             if (this == obj)
280                 return true;
281             if (obj == null)
282                 return false;
283             if (!(obj instanceof JulianDate))
284                 return false;
285             JulianDate other = (JulianDate) obj;
286             if (Double.doubleToLongBits(djm0) != Double
287                     .doubleToLongBits(other.djm0))
288                 return false;
289             if (Double.doubleToLongBits(djm1) != Double
290                     .doubleToLongBits(other.djm1))
291                 return false;
292             return true;
293         }
294         /**
295          * {@inheritDoc}
296          * overrides @see java.lang.Object#toString()
297          */
298         @Override
299         public String toString() {        
300             return "MJD=" +Double.toString(djm0 + djm1  - DJM0);
301         }
302     }
303  
304     /**
305     * Decompose radians into degrees, arcminutes, arcseconds, fraction.
306     *  
307     *
308     *  <p>This function is derived from the International Astronomical Union's
309     *  SOFA (Standards Of Fundamental Astronomy) software collection.
310     *
311     *  <p>Status:  vector/matrix support function.
312     *  
313     *
314     *
315     *<p>Called:<ul>
316     *     <li>{@link #jauD2tf}      decompose days to hms
317     *</ul>
318     * <p>Notes:
319     *<ol>
320     *  <li> The argument ndp is interpreted as follows:
321     *
322     * <pre>
323     *     ndp         resolution
324     *      :      ...0000 00 00
325     *     -7         1000 00 00
326     *     -6          100 00 00
327     *     -5           10 00 00
328     *     -4            1 00 00
329     *     -3            0 10 00
330     *     -2            0 01 00
331     *     -1            0 00 10
332     *      0            0 00 01
333     *      1            0 00 00.1
334     *      2            0 00 00.01
335     *      3            0 00 00.001
336     *      :            0 00 00.000...
337     *</pre>
338     *  <li> The largest positive useful value for ndp is determined by the
339     *     size of angle, the format of doubles on the target platform, and
340     *     the risk of overflowing idmsf[3].  On a typical platform, for
341     *     angle up to 2pi, the available floating-point precision might
342     *     correspond to ndp=12.  However, the practical limit is typically
343     *     ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
344     *     only 16 bits.
345     *
346     *  <li> The absolute value of angle may exceed 2pi.  In cases where it
347     *     does not, it is up to the caller to test for and handle the
348     *     case where angle is very nearly 2pi and rounds up to 360 degrees,
349     *     by testing for idmsf[0]=360 and setting idmsf[0-3] to zero.
350     *</ol>
351     *@version 2008 May 27
352     *
353     *  @since Release 20101201
354     *
355     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
356     * <!-- Given: -->
357     *    @param ndp     int     resolution (Note 1)
358     *    @param angle   double  angle in radians
359     *    @param idmsf   int[4] <u>returned</u> degrees, arcminutes, arcseconds, fraction
360     * <!-- Returned: -->
361     *    @return sign    char    '+' or '-'
362     */
363     public static char jauA2af(final int ndp, final double angle,  int idmsf[] ){
364         /* Hours to degrees * radians to turns */
365         final double F = 15.0 / D2PI;
366 
367 
368      /* Scale then use days to h,m,s function. */
369         char retval = jauD2tf(ndp, angle*F, idmsf);
370 
371         return retval;
372 
373         
374     }
375     
376 
377     
378     /**
379     *  Decompose radians into hours, minutes, seconds, fraction.
380     *
381     *<p>This function is derived from the International Astronomical Union's
382     *  SOFA (Standards Of Fundamental Astronomy) software collection.
383     *
384     *<p>Status:  vector/matrix support function.
385     *
386     *<!-- Given: -->
387     *     @param ndp      int      resolution (Note 1)
388     *     @param angle    double   angle in radians
389     *
390     *<!-- Returned: -->
391     *     @param ihmsf    int[4]    <u>returned</u> hours, minutes, seconds, fraction
392     *     @return sign     char      <u>returned</u> '+' or '-'
393     *
394     *<p>Called:<ul>
395     *     <li>{@link #jauD2tf} decompose days to hms
396     * </ul>
397     * <p>Notes:
398     * <ol>
399     *
400     * <li> The argument ndp is interpreted as follows:
401     * <pre>
402     *     ndp         resolution
403     *      :      ...0000 00 00
404     *     -7         1000 00 00
405     *     -6          100 00 00
406     *     -5           10 00 00
407     *     -4            1 00 00
408     *     -3            0 10 00
409     *     -2            0 01 00
410     *     -1            0 00 10
411     *      0            0 00 01
412     *      1            0 00 00.1
413     *      2            0 00 00.01
414     *      3            0 00 00.001
415     *      :            0 00 00.000...
416     *</pre>
417     * <li> The largest positive useful value for ndp is determined by the
418     *     size of angle, the format of doubles on the target platform, and
419     *     the risk of overflowing ihmsf[3].  On a typical platform, for
420     *     angle up to 2pi, the available floating-point precision might
421     *     correspond to ndp=12.  However, the practical limit is typically
422     *     ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
423     *     only 16 bits.
424     *
425     * <li> The absolute value of angle may exceed 2pi.  In cases where it
426     *     does not, it is up to the caller to test for and handle the
427     *     case where angle is very nearly 2pi and rounds up to 24 hours,
428     *     by testing for ihmsf[0]=24 and setting ihmsf[1-3] to zero.
429     *</ol>
430     *  @version 2008 May 11
431     *
432     *  @since Release 20101201
433     *
434     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
435     */
436     public static char jauA2tf(final int ndp, final double angle, int ihmsf[])
437     {
438     /* Scale then use days to h,m,s function. */
439      return  jauD2tf(ndp, angle/D2PI, ihmsf);
440 
441      }
442     
443 
444     /**
445     *  Normalize angle into the range {@code 0 <= a < 2pi}.
446     *
447     *<p>This function is derived from the International Astronomical Union's
448     *  SOFA (Standards Of Fundamental Astronomy) software collection.
449     *
450     *<p>Status:  vector/matrix support function.
451     *
452     *<!-- Given: -->
453     *     @param a         double      angle (radians)
454     *
455     * <!-- Returned (function value): -->
456     *  @return double     angle in range 0-2pi
457     *
458     *@version 2008 May 16
459     *
460     *  @since Release 20101201
461     *
462     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
463     */
464     public static double jauAnp(final double a)
465    {
466        double w;
467 
468 
469        w = fmod(a, D2PI);
470        if (w < 0) w += D2PI;
471 
472        return w;
473 
474     }
475     
476 
477     /**
478     *  Normalize angle into the range  {@code -pi <= a < +pi}.
479     *
480     *<p>This function is derived from the International Astronomical Union's
481     *  SOFA (Standards Of Fundamental Astronomy) software collection.
482     *
483     *<p>Status:  vector/matrix support function.
484     *
485     *<!-- Given: -->
486     *     @param a         double      angle (radians)
487     *
488     * <!-- Returned (function value): -->
489     *  @return double     angle in range +/-pi
490     *
491     *@version 2008 May 16
492     *
493     *  @since Release 20101201
494     *
495     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
496     */
497     public static double jauAnpm(final double a)
498     {
499        double w;
500 
501 
502        w = fmod(a, D2PI);
503        if (abs(w) >= DPI) w -= dsign(D2PI, a);
504 
505        return w;
506 
507         }
508     /**
509      * Frame bias components of IAU 2000 precession-nutation models.
510      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 2 Feb 2010
511      * 
512      * @since AIDA Stage 1
513      */
514     public static class FrameBias {
515         /** longitude  corrections */
516         public double dpsibi;
517         /**obliquity corrections */
518         public double depsbi;
519         /** the ICRS RA of the J2000.0 mean equinox */
520         public double dra;
521     };
522 
523     /**
524     *  Frame bias components of IAU 2000 precession-nutation models part
525     *  of the Mathews-Herring-Buffett (MHB2000) nutation series, with additions.
526     *
527     *<p>This function is derived from the International Astronomical Union's
528     *  SOFA (Standards Of Fundamental Astronomy) software collection.
529     *
530     *<p>Status:  canonical model.
531     *
532     *<!-- Returned: -->
533     *     @return dpsibi,depsbi   double    <u>returned</u> longitude and obliquity corrections
534     *             dra             double    <u>returned</u> the ICRS RA of the J2000.0 mean equinox
535     *
536     * <p>Notes:
537     * <ol>
538     *
539     * <li> The frame bias corrections in longitude and obliquity (radians)
540     *     are required in order to correct for the offset between the GCRS
541     *     pole and the mean J2000.0 pole.  They define, with respect to the
542     *     GCRS frame, a J2000.0 mean pole that is consistent with the rest
543     *     of the IAU 2000A precession-nutation model.
544     *
545     * <li> In addition to the displacement of the pole, the complete
546     *     description of the frame bias requires also an offset in right
547     *     ascension.  This is not part of the IAU 2000A model, and is from
548     *     Chapront et al. (2002).  It is returned in radians.
549     *
550     * <li> This is a supplemented implementation of one aspect of the IAU
551     *     2000A nutation model, formally adopted by the IAU General
552     *     Assembly in 2000, namely MHB2000 (Mathews et al. 2002).
553     *</ol>
554     *<p>References:
555     *
556     *     Chapront, J., Chapront-Touze, M. &amp;Francou, G., Astron.
557     *     Astrophys., 387, 700, 2002.
558     *
559     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A., "Modeling of nutation
560     *     and precession   New nutation series for nonrigid Earth and
561     *     insights into the Earth's interior", J.Geophys.Res., 107, B4,
562     *     2002.  The MHB2000 code itself was obtained on 9th September 2002
563     *     from ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
564     *
565     *@version 2009 December 17
566     *
567     *  @since Release 20101201
568     *
569     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
570     */
571     public static FrameBias jauBi00()
572    {
573     /* The frame bias corrections in longitude and obliquity */
574        final double DPBIAS = -0.041775  * DAS2R,
575                     DEBIAS = -0.0068192 * DAS2R;
576 
577     /* The ICRS RA of the J2000.0 equinox (Chapront et al., 2002) */
578        final double DRA0 = -0.0146 * DAS2R;
579 
580 
581     /* Return the results (which are fixed). */
582        FrameBias retval = new FrameBias();
583        retval.dpsibi = DPBIAS;
584        retval.depsbi = DEBIAS;
585        retval.dra = DRA0;
586 
587        return retval;
588 
589         }
590     
591 
592     /**
593     *  Frame bias and precession, IAU 2000.
594     *
595     *<p>This function is derived from the International Astronomical Union's
596     *  SOFA (Standards Of Fundamental Astronomy) software collection.
597     *
598     *<p>Status:  canonical model.
599     *
600     *<!-- Given: -->
601     *      @param date1  double          TT as a 2-part Julian Date (Note 1)
602     *      @param date2   double          TT as a 2-part Julian Date (Note 1)
603     *
604     *<!-- Returned: -->
605     *     @param rb            double[3][3]     <u>returned</u> frame bias matrix (Note 2)
606     *     @param rp            double[3][3]     <u>returned</u> precession matrix (Note 3)
607     *     @param rbp           double[3][3]     <u>returned</u> bias-precession matrix (Note 4)
608     *
609     * <p>Notes:
610     * <ol>
611     *
612     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
613     *     convenient way between the two arguments.  For example,
614     *     JD(TT)=2450123.7 could be expressed in any of these ways,
615     *     among others:
616     *<pre>
617     *             date1         date2
618     *
619     *         2450123.7           0.0       (JD method)
620     *         2451545.0       -1421.3       (J2000 method)
621     *         2400000.5       50123.2       (MJD method)
622     *         2450123.5           0.2       (date &amp;time method)
623     *</pre>
624     *     The JD method is the most natural and convenient to use in
625     *     cases where the loss of several decimal digits of resolution
626     *     is acceptable.  The J2000 method is best matched to the way
627     *     the argument is handled internally and will deliver the
628     *     optimum resolution.  The MJD method and the date &amp;time methods
629     *     are both good compromises between resolution and convenience.
630     *
631     * <li> The matrix rb transforms vectors from GCRS to mean J2000.0 by
632     *     applying frame bias.
633     *
634     * <li> The matrix rp transforms vectors from J2000.0 mean equator and
635     *     equinox to mean equator and equinox of date by applying
636     *     precession.
637     *
638     * <li> The matrix rbp transforms vectors from GCRS to mean equator and
639     *     equinox of date by applying frame bias then precession.  It is
640     *     the product rp x rb.
641     *
642     * <li> It is permissible to re-use the same array in the returned
643     *     arguments.  The arrays are filled in the order given.
644     *</ol>
645     *<p>Called:<ul>
646     *     <li>{@link #jauBi00} frame bias components, IAU 2000
647     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
648     *     <li>{@link #jauIr} initialize r-matrix to identity
649     *     <li>{@link #jauRx} rotate around X-axis
650     *     <li>{@link #jauRy} rotate around Y-axis
651     *     <li>{@link #jauRz} rotate around Z-axis
652     *     <li>{@link #jauCr} copy r-matrix
653     *     <li>{@link #jauRxr} product of two r-matrices
654     * </ul>
655     *<p>Reference:
656     *     "Expressions for the Celestial Intermediate Pole and Celestial
657     *     Ephemeris Origin consistent with the IAU 2000A precession-
658     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
659     *
660     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
661     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
662     *
663     *@version 2010 January 18
664     *
665     *  @since Release 20101201
666     *
667     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
668     */
669     public static void jauBp00(final double  date1, final double date2,
670             double rb[][], double rp[][], double rbp[][])
671     {
672     /* J2000.0 obliquity (Lieske et al. 1977) */
673        final double EPS0 = 84381.448 * DAS2R;
674 
675        double t, dpsibi, depsbi;
676        double dra0, psia77, oma77, chia, dpsipr, depspr, psia, oma,
677               rbw[][] = new double[3][3];
678 
679 
680     /* Interval between fundamental epoch J2000.0 and current date (JC). */
681        t = ((date1 - DJ00) + date2) / DJC;
682 
683     /* Frame bias. */
684        FrameBias fb = jauBi00();
685        dpsibi = fb.dpsibi;
686        depsbi = fb.depsbi;
687        dra0 = fb.dra;
688     /* Precession angles (Lieske et al. 1977) */
689        psia77 = (5038.7784 + (-1.07259 + (-0.001147) * t) * t) * t * DAS2R;
690        oma77  =       EPS0 + ((0.05127 + (-0.007726) * t) * t) * t * DAS2R;
691        chia   = (  10.5526 + (-2.38064 + (-0.001125) * t) * t) * t * DAS2R;
692 
693     /* Apply IAU 2000 precession corrections. */
694        PrecessionDeltaTerms pc = jauPr00(date1, date2);
695        dpsipr = pc.dpsipr;  depspr = pc.depspr;
696        psia = psia77 + dpsipr;
697        oma  = oma77  + depspr;
698 
699     /* Frame bias matrix: GCRS to J2000.0. */
700        jauIr(rbw);
701        jauRz(dra0, rbw);
702        jauRy(dpsibi * sin(EPS0), rbw);
703        jauRx(-depsbi, rbw);
704        jauCr(rbw, rb);
705 
706     /* Precession matrix: J2000.0 to mean of date. */
707        jauIr(rp);
708        jauRx(EPS0,  rp);
709        jauRz(-psia, rp);
710        jauRx(-oma,  rp);
711        jauRz(chia,  rp);
712 
713     /* Bias-precession matrix: GCRS to mean of date. */
714        double[][] rt = jauRxr(rp, rbw );
715        jauCr(rt, rbp);
716        return;
717 
718         }
719     
720 
721     /**
722     *  Frame bias and precession, IAU 2006.
723     *
724     *<p>This function is derived from the International Astronomical Union's
725     *  SOFA (Standards Of Fundamental Astronomy) software collection.
726     *
727     *<p>Status:  support function.
728     *
729     *<!-- Given: -->
730     *     @param date1 double TT as a 2-part Julian Date (Note 1)
731     *     @param date2 double TT as a 2-part Julian Date (Note 1)
732     *
733     *<!-- Returned: -->
734     *     @param rb            double[3][3]     <u>returned</u> frame bias matrix (Note 2)
735     *     @param rp            double[3][3]     <u>returned</u> precession matrix (Note 3)
736     *     @param rbp           double[3][3]     <u>returned</u> bias-precession matrix (Note 4)
737     *
738     * <p>Notes:
739     * <ol>
740     *
741     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
742     *     convenient way between the two arguments.  For example,
743     *     JD(TT)=2450123.7 could be expressed in any of these ways,
744     *     among others:
745     *<pre>
746     *             date1         date2
747     *
748     *         2450123.7           0.0       (JD method)
749     *         2451545.0       -1421.3       (J2000 method)
750     *         2400000.5       50123.2       (MJD method)
751     *         2450123.5           0.2       (date &amp;time method)
752     *</pre>
753     *     The JD method is the most natural and convenient to use in
754     *     cases where the loss of several decimal digits of resolution
755     *     is acceptable.  The J2000 method is best matched to the way
756     *     the argument is handled internally and will deliver the
757     *     optimum resolution.  The MJD method and the date &amp;time methods
758     *     are both good compromises between resolution and convenience.
759     *
760     * <li> The matrix rb transforms vectors from GCRS to mean J2000.0 by
761     *     applying frame bias.
762     *
763     * <li> The matrix rp transforms vectors from mean J2000.0 to mean of
764     *     date by applying precession.
765     *
766     * <li> The matrix rbp transforms vectors from GCRS to mean of date by
767     *     applying frame bias then precession.  It is the product rp x rb.
768     * 
769     *  <li> It is permissible to re-use the same array in the returned
770     *        arguments.  The arrays are filled in the order given.
771     *</ol>
772     *<p>Called:<ul>
773     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
774     *     <li>{@link #jauFw2m} F-W angles to r-matrix
775     *     <li>{@link #jauPmat06} PB matrix, IAU 2006
776     *     <li>{@link #jauTr} transpose r-matrix
777     *     <li>{@link #jauRxr} product of two r-matrices
778     * </ul>
779     *<p>References:
780     *
781     *     <p>Capitaine, N. &amp;Wallace, P.T., 2006, Astron.Astrophys. 450, 855
782     *
783     *     <p>Wallace, P.T. &amp;Capitaine, N., 2006, Astron.Astrophys. 459, 981
784     *
785     *@version 2009 December 17
786     *
787     *  @since Release 20101201
788     *
789     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
790     */
791         public static void jauBp06(final double date1, final double date2,
792                  double rb[][], double rp[][], double rbp[][])
793     {
794        double rbt[][];
795 
796 
797     /* B matrix. */
798        FWPrecessionAngles fw = jauPfw06(DJM0, DJM00);
799        double[][] rt = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa);
800        jauCr(rt, rb);
801 
802     /* PxB matrix. */
803        rt = jauPmat06(date1, date2 );
804        jauCr(rt, rbp);
805 
806     /* P matrix. */
807        rbt = jauTr(rb);
808        rt = jauRxr(rbp, rbt);
809        jauCr(rt, rp);
810 
811        return;
812 
813         }
814     
815      /**
816      * The components x,y are components of the Celestial Intermediate
817      *     Pole unit vector in the Geocentric Celestial Reference System.
818      *     
819      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 29 Jan 2010
820      * 
821      * @since AIDA Stage 1
822      */
823     public static class CelestialIntermediatePole {
824          public double x; 
825          public double y;
826          public CelestialIntermediatePole(double x, double y) {
827             this.x = x;
828             this.y = y;
829         }
830      }
831     /**
832     *  Extract from the bias-precession-nutation matrix the X,Y coordinates
833     *  of the Celestial Intermediate Pole.
834     *
835     *<p>This function is derived from the International Astronomical Union's
836     *  SOFA (Standards Of Fundamental Astronomy) software collection.
837     *
838     *<p>Status:  support function.
839     *
840     *<!-- Given: -->
841     *     @param rbpn       double[3][3]   celestial-to-true matrix (Note 1)
842     *
843     *<!-- Returned: -->
844     *     @return     <u>returned</u> Celestial Intermediate Pole (Note 2)
845     *
846     * <p>Notes:
847     * <ol>
848     *
849     * <li> The matrix rbpn transforms vectors from GCRS to true equator (and
850     *     CIO or equinox) of date, and therefore the Celestial Intermediate
851     *     Pole unit vector is the bottom row of the matrix.
852     *
853     * <li> The arguments x,y are components of the Celestial Intermediate
854     *     Pole unit vector in the Geocentric Celestial Reference System.
855     *</ol>
856     *<p>Reference:
857     *
858     *     "Expressions for the Celestial Intermediate Pole and Celestial
859     *     Ephemeris Origin consistent with the IAU 2000A precession-
860     *     nutation model", Astron.Astrophys. 400, 1145-1154
861     *     (2003)
862     *
863     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
864     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
865     *
866     *@version 2010 January 18
867     *
868     *  @since Release 20101201
869     *
870     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
871     */
872         public static CelestialIntermediatePole  jauBpn2xy(double rbpn[][])
873     {
874     /* Extract the X,Y coordinates. */
875 
876        return new CelestialIntermediatePole(rbpn[2][0], rbpn[2][1]);
877 
878         }
879     
880 
881     /**
882     *  Form the celestial-to-intermediate matrix for a given date using the
883     *  IAU 2000A precession-nutation model.
884     *
885     *<p>This function is derived from the International Astronomical Union's
886     *  SOFA (Standards Of Fundamental Astronomy) software collection.
887     *
888     *<p>Status:  support function.
889     *
890     *<!-- Given: -->
891     *     @param date1 double TT as a 2-part Julian Date (Note 1)
892     *     @param date2 double TT as a 2-part Julian Date (Note 1)
893     *
894     *<!-- Returned: -->
895     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 2)
896     *
897     * <p>Notes:
898     * <ol>
899     *
900     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
901     *     convenient way between the two arguments.  For example,
902     *     JD(TT)=2450123.7 could be expressed in any of these ways,
903     *     among others:
904     *<pre>
905     *            date1          date2
906     *
907     *         2450123.7           0.0       (JD method)
908     *         2451545.0       -1421.3       (J2000 method)
909     *         2400000.5       50123.2       (MJD method)
910     *         2450123.5           0.2       (date &amp;time method)
911     *</pre>
912     *     The JD method is the most natural and convenient to use in
913     *     cases where the loss of several decimal digits of resolution
914     *     is acceptable.  The J2000 method is best matched to the way
915     *     the argument is handled internally and will deliver the
916     *     optimum resolution.  The MJD method and the date &amp;time methods
917     *     are both good compromises between resolution and convenience.
918     *
919     * <li> The matrix rc2i is the first stage in the transformation from
920     *     celestial to terrestrial coordinates:
921     *
922     *        [TRS]  =  RPOM * R_3(ERA) * rc2i * [CRS]
923     *
924     *               =  rc2t * [CRS]
925     *
926     *     where [CRS] is a vector in the Geocentric Celestial Reference
927     *     System and [TRS] is a vector in the International Terrestrial
928     *     Reference System (see IERS Conventions 2003), ERA is the Earth
929     *     Rotation Angle and RPOM is the polar motion matrix.
930     *
931     * <li> A faster, but slightly less accurate, result (about 1 mas), can be
932     *     obtained by using instead the jauC2i00b function.
933     *</ol>
934     *<p>Called:<ul>
935     *     <li>{@link #jauPnm00a} classical NPB matrix, IAU 2000A
936     *     <li>{@link #jauC2ibpn} celestial-to-intermediate matrix, given NPB matrix
937     * </ul>
938     *<p>References:
939     *<ul>
940     *     <li>"Expressions for the Celestial Intermediate Pole and Celestial
941     *     Ephemeris Origin consistent with the IAU 2000A precession-
942     *     nutation model", Astron.Astrophys. 400, 1145-1154
943     *     (2003)
944     *
945     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
946     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
947     *
948     *    <li>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
949     *     IERS Technical Note No. 32, BKG (2004)
950     *</ul>
951     *@version 2010 January 18
952     *
953     *  @since Release 20101201
954     *
955     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
956     */
957     public static double[][] jauC2i00a(double date1, double date2)
958     {
959 
960 
961     /* Obtain the celestial-to-true matrix (IAU 2000A). */
962        double rbpn[][] = jauPnm00a(date1, date2);
963 
964     /* Form the celestial-to-intermediate matrix. */
965        double rc2i[][]  =jauC2ibpn(date1, date2, rbpn);
966 
967        return rc2i;
968 
969         }
970     
971 
972     /**
973     *  Form the celestial-to-intermediate matrix for a given date using the
974     *  IAU 2000B precession-nutation model.
975     *
976     *<p>This function is derived from the International Astronomical Union's
977     *  SOFA (Standards Of Fundamental Astronomy) software collection.
978     *
979     *<p>Status:  support function.
980     *
981     *<!-- Given: -->
982     *     @param date1 double TT as a 2-part Julian Date (Note 1)
983     *     @param date2 double TT as a 2-part Julian Date (Note 1)
984     *
985     *<!-- Returned: -->
986     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 2)
987     *
988     * <p>Notes:
989     * <ol>
990     *
991     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
992     *     convenient way between the two arguments.  For example,
993     *     JD(TT)=2450123.7 could be expressed in any of these ways,
994     *     among others:
995     *<pre>
996     *            date1          date2
997     *
998     *         2450123.7           0.0       (JD method)
999     *         2451545.0       -1421.3       (J2000 method)
1000     *         2400000.5       50123.2       (MJD method)
1001     *         2450123.5           0.2       (date &amp;time method)
1002     *</pre>
1003     *     The JD method is the most natural and convenient to use in
1004     *     cases where the loss of several decimal digits of resolution
1005     *     is acceptable.  The J2000 method is best matched to the way
1006     *     the argument is handled internally and will deliver the
1007     *     optimum resolution.  The MJD method and the date &amp;time methods
1008     *     are both good compromises between resolution and convenience.
1009     *
1010     * <li> The matrix rc2i is the first stage in the transformation from
1011     *     celestial to terrestrial coordinates:
1012     *
1013     *        [TRS]  =  RPOM * R_3(ERA) * rc2i * [CRS]
1014     *
1015     *               =  rc2t * [CRS]
1016     *
1017     *     where [CRS] is a vector in the Geocentric Celestial Reference
1018     *     System and [TRS] is a vector in the International Terrestrial
1019     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1020     *     Rotation Angle and RPOM is the polar motion matrix.
1021     *
1022     * <li> The present function is faster, but slightly less accurate (about
1023     *     1 mas), than the jauC2i00a function.
1024     *</ol>
1025     *<p>Called:<ul>
1026     *     <li>{@link #jauPnm00b} classical NPB matrix, IAU 2000B
1027     *     <li>{@link #jauC2ibpn} celestial-to-intermediate matrix, given NPB matrix
1028     * </ul>
1029     *<p>References:
1030     *
1031     *    <p> "Expressions for the Celestial Intermediate Pole and Celestial
1032     *     Ephemeris Origin consistent with the IAU 2000A precession-
1033     *     nutation model", Astron.Astrophys. 400, 1145-1154
1034     *     (2003)
1035     *
1036     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
1037     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
1038     *
1039     *    <p> McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1040     *     IERS Technical Note No. 32, BKG (2004)
1041     *
1042     *@version 2010 January 18
1043     *
1044     *  @since Release 20101201
1045     *
1046     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1047     */
1048     public static double[][] jauC2i00b(double date1, double date2)
1049     {
1050        double rbpn[][];
1051        double rc2i[][];
1052 
1053     /* Obtain the celestial-to-true matrix (IAU 2000B). */
1054        rbpn = jauPnm00b(date1, date2 );
1055 
1056     /* Form the celestial-to-intermediate matrix. */
1057        rc2i = jauC2ibpn(date1, date2, rbpn);
1058 
1059        return rc2i;
1060 
1061         }
1062     
1063 
1064     /**
1065     *  Form the celestial-to-intermediate matrix for a given date using the
1066     *  IAU 2006 precession and IAU 2000A nutation models.
1067     *
1068     *<p>This function is derived from the International Astronomical Union's
1069     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1070     *
1071     *<p>Status:  support function.
1072     *
1073     *<!-- Given: -->
1074     *     @param date1 double TT as a 2-part Julian Date (Note 1)
1075     *     @param date2 double TT as a 2-part Julian Date (Note 1)
1076     *
1077     *<!-- Returned: -->
1078     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 2)
1079     *
1080     * <p>Notes:
1081     * <ol>
1082     *
1083     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
1084     *     convenient way between the two arguments.  For example,
1085     *     JD(TT)=2450123.7 could be expressed in any of these ways,
1086     *     among others:
1087     *<pre>
1088     *            date1          date2
1089     *
1090     *         2450123.7           0.0       (JD method)
1091     *         2451545.0       -1421.3       (J2000 method)
1092     *         2400000.5       50123.2       (MJD method)
1093     *         2450123.5           0.2       (date &amp;time method)
1094     *</pre>
1095     *     The JD method is the most natural and convenient to use in
1096     *     cases where the loss of several decimal digits of resolution
1097     *     is acceptable.  The J2000 method is best matched to the way
1098     *     the argument is handled internally and will deliver the
1099     *     optimum resolution.  The MJD method and the date &amp;time methods
1100     *     are both good compromises between resolution and convenience.
1101     *
1102     * <li> The matrix rc2i is the first stage in the transformation from
1103     *     celestial to terrestrial coordinates:
1104     *
1105     *        [TRS]  =  RPOM * R_3(ERA) * rc2i * [CRS]
1106     *
1107     *               =  RC2T * [CRS]
1108     *
1109     *     where [CRS] is a vector in the Geocentric Celestial Reference
1110     *     System and [TRS] is a vector in the International Terrestrial
1111     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1112     *     Rotation Angle and RPOM is the polar motion matrix.
1113     *</ol>
1114     *<p>Called:<ul>
1115     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
1116     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
1117     *     <li>{@link #jauS06} the CIO locator s, Given X,Y, IAU 2006
1118     *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, Given X,Y and s
1119     * </ul>
1120     *<p>References:
1121     *
1122     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
1123     *     IERS Technical Note No. 32, BKG
1124     *
1125     *@version 2008 May 13
1126     *
1127     *  @since Release 20101201
1128     *
1129     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1130     */
1131     public static double[][] jauC2i06a(double date1, double date2)
1132     {
1133        double rbpn[][], s,  rc2i[][];
1134 
1135 
1136     /* Obtain the celestial-to-true matrix (IAU 2006/2000A). */
1137        rbpn = jauPnm06a(date1, date2);
1138 
1139     /* Extract the X,Y coordinates. */
1140        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
1141 
1142     /* Obtain the CIO locator. */
1143        s = jauS06(date1, date2, cip.x, cip.y);
1144 
1145     /* Form the celestial-to-intermediate matrix. */
1146        rc2i = jauC2ixys(cip.x, cip.y, s);
1147 
1148        return rc2i;
1149 
1150         }
1151     
1152 
1153     /**
1154     *  Form the celestial-to-intermediate matrix for a given date given
1155     *  the bias-precession-nutation matrix.  IAU 2000.
1156     *
1157     *<p>This function is derived from the International Astronomical Union's
1158     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1159     *
1160     *<p>Status:  support function.
1161     *
1162     *<!-- Given: -->
1163     *     @param date1 double TT as a 2-part Julian Date (Note 1)
1164     *     @param date2 double TT as a 2-part Julian Date (Note 1)
1165     *     @param rbpn         double[3][3]  celestial-to-true matrix (Note 2)
1166     *
1167     *<!-- Returned: -->
1168     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 3)
1169     *
1170     * <p>Notes:
1171     * <ol>
1172     *
1173     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
1174     *     convenient way between the two arguments.  For example,
1175     *     JD(TT)=2450123.7 could be expressed in any of these ways,
1176     *     among others:
1177     *<pre>
1178     *            date1          date2
1179     *
1180     *         2450123.7           0.0       (JD method)
1181     *         2451545.0       -1421.3       (J2000 method)
1182     *         2400000.5       50123.2       (MJD method)
1183     *         2450123.5           0.2       (date &amp;time method)
1184     *</pre>
1185     *     The JD method is the most natural and convenient to use in
1186     *     cases where the loss of several decimal digits of resolution
1187     *     is acceptable.  The J2000 method is best matched to the way
1188     *     the argument is handled internally and will deliver the
1189     *     optimum resolution.  The MJD method and the date &amp;time methods
1190     *     are both good compromises between resolution and convenience.
1191     *
1192     * <li> The matrix rbpn transforms vectors from GCRS to true equator (and
1193     *     CIO or equinox) of date.  Only the CIP (bottom row) is used.
1194     *
1195     * <li> The matrix rc2i is the first stage in the transformation from
1196     *     celestial to terrestrial coordinates:
1197     *
1198     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1199     *
1200     *              = RC2T * [CRS]
1201     *
1202     *     where [CRS] is a vector in the Geocentric Celestial Reference
1203     *     System and [TRS] is a vector in the International Terrestrial
1204     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1205     *     Rotation Angle and RPOM is the polar motion matrix.
1206     *
1207     * <li> Although its name does not include "00", This function is in fact
1208     *     specific to the IAU 2000 models.
1209     *</ol>
1210     *<p>Called:<ul>
1211     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
1212     *     <li>{@link #jauC2ixy} celestial-to-intermediate matrix, given X,Y
1213     * </ul>
1214     *<p>References:
1215     *    <p> "Expressions for the Celestial Intermediate Pole and Celestial
1216     *     Ephemeris Origin consistent with the IAU 2000A precession-
1217     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
1218     *
1219     *     <p>n.b. The celestial ephemeris origin (CEO) was renamed "celestial
1220     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
1221     *
1222     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1223     *     IERS Technical Note No. 32, BKG (2004)
1224     *
1225     *@version 2010 January 18
1226     *
1227     *  @since Release 20101201
1228     *
1229     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1230     */
1231     public static double[][] jauC2ibpn(double date1, double date2, double rbpn[][])
1232     {
1233 
1234     /* Extract the X,Y coordinates. */
1235        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
1236        
1237        
1238     /* Form the celestial-to-intermediate matrix (n.b. IAU 2000 specific). */
1239        double rc2i[][] =jauC2ixy(date1, date2, cip.x, cip.y);
1240 
1241        return rc2i;
1242 
1243         }
1244     
1245 
1246     /**
1247     *  Form the celestial to intermediate-frame-of-date matrix for a given
1248     *  date when the CIP X,Y coordinates are known.  IAU 2000.
1249     *
1250     *<p>This function is derived from the International Astronomical Union's
1251     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1252     *
1253     *<p>Status:  support function.
1254     *
1255     *<!-- Given: -->
1256     *     @param date1 double TT as a 2-part Julian Date (Note 1)
1257     *     @param date2 double TT as a 2-part Julian Date (Note 1)
1258     *     @param x double        Celestial Intermediate Pole (Note 2)
1259     *     @param y double        Celestial Intermediate Pole (Note 2) 
1260     *
1261     *<!-- Returned: -->
1262     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 3)
1263     *
1264     * <p>Notes:
1265     * <ol>
1266     *
1267     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
1268     *     convenient way between the two arguments.  For example,
1269     *     JD(TT)=2450123.7 could be expressed in any of these ways,
1270     *     among others:
1271     *<pre>
1272     *            date1          date2
1273     *
1274     *         2450123.7           0.0       (JD method)
1275     *         2451545.0       -1421.3       (J2000 method)
1276     *         2400000.5       50123.2       (MJD method)
1277     *         2450123.5           0.2       (date &amp;time method)
1278     *</pre>
1279     *     The JD method is the most natural and convenient to use in
1280     *     cases where the loss of several decimal digits of resolution
1281     *     is acceptable.  The J2000 method is best matched to the way
1282     *     the argument is handled internally and will deliver the
1283     *     optimum resolution.  The MJD method and the date &amp;time methods
1284     *     are both good compromises between resolution and convenience.
1285     *
1286     * <li> The Celestial Intermediate Pole coordinates are the x,y components
1287     *     of the unit vector in the Geocentric Celestial Reference System.
1288     *
1289     * <li> The matrix rc2i is the first stage in the transformation from
1290     *     celestial to terrestrial coordinates:
1291     *
1292     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1293     *
1294     *              = RC2T * [CRS]
1295     *
1296     *     where [CRS] is a vector in the Geocentric Celestial Reference
1297     *     System and [TRS] is a vector in the International Terrestrial
1298     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1299     *     Rotation Angle and RPOM is the polar motion matrix.
1300     *
1301     * <li> Although its name does not include "00", This function is in fact
1302     *     specific to the IAU 2000 models.
1303     *</ol>
1304     *<p>Called:<ul>
1305     *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, given X,Y and s
1306     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
1307     * </ul>
1308     *<p>Reference:
1309     *
1310     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1311     *     IERS Technical Note No. 32, BKG (2004)
1312     *
1313     *@version 2008 May 11
1314     *
1315     *  @since Release 20101201
1316     *
1317     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1318     */
1319 
1320     public static  double[][] jauC2ixy(double date1, double date2, double x, double y)
1321     {
1322     /* Compute s and then the matrix. */
1323        double rc2i[][] = jauC2ixys(x, y, jauS00(date1, date2, x, y));
1324 
1325        return rc2i;
1326 
1327         }
1328     
1329 
1330     /**
1331     *  Form the celestial to intermediate-frame-of-date matrix given the CIP
1332     *  X,Y and the CIO locator s.
1333     *
1334     *<p>This function is derived from the International Astronomical Union's
1335     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1336     *
1337     *<p>Status:  support function.
1338     *
1339     *<!-- Given: -->
1340     *     @param x double          Celestial Intermediate Pole (Note 1)
1341     *     @param y double          Celestial Intermediate Pole (Note 1) 
1342     *     @param s         double          the CIO locator s (Note 2)
1343     *
1344     *<!-- Returned: -->
1345     *     @return rc2i      double[3][3]     <u>returned</u> celestial-to-intermediate matrix (Note 3)
1346     *
1347     * <p>Notes:
1348     * <ol>
1349     *
1350     * <li> The Celestial Intermediate Pole coordinates are the x,y
1351     *     components of the unit vector in the Geocentric Celestial
1352     *     Reference System.
1353     *
1354     * <li> The CIO locator s (in radians) positions the Celestial
1355     *     Intermediate Origin on the equator of the CIP.
1356     *
1357     * <li> The matrix rc2i is the first stage in the transformation from
1358     *     celestial to terrestrial coordinates:
1359     *
1360     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1361     *
1362     *              = RC2T * [CRS]
1363     *
1364     *     where [CRS] is a vector in the Geocentric Celestial Reference
1365     *     System and [TRS] is a vector in the International Terrestrial
1366     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1367     *     Rotation Angle and RPOM is the polar motion matrix.
1368     *</ol>
1369     *<p>Called:<ul>
1370     *     <li>{@link #jauIr} initialize r-matrix to identity
1371     *     <li>{@link #jauRz} rotate around Z-axis
1372     *     <li>{@link #jauRy} rotate around Y-axis
1373     * </ul>
1374     *<p>Reference:
1375     *
1376     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1377     *     IERS Technical Note No. 32, BKG (2004)
1378     *
1379     *@version 2008 May 11
1380     *
1381     *  @since Release 20101201
1382     *
1383     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1384     */
1385     public static double[][] jauC2ixys(double x, double y, double s)
1386     {
1387        double r2, e, d;
1388        double rc2i[][] = new double[3][3];
1389 
1390     /* Obtain the spherical angles E and d. */
1391        r2 = x*x + y*y;
1392        e = (r2 > 0.0) ? atan2(y, x) : 0.0;
1393        d = atan(sqrt(r2 / (1.0 - r2)));
1394 
1395     /* Form the matrix. */
1396        jauIr(rc2i);
1397        jauRz(e, rc2i);
1398        jauRy(d, rc2i);
1399        jauRz(-(e+s), rc2i);
1400 
1401        return rc2i;
1402 
1403         }
1404     
1405     /**
1406     *  P-vector to spherical coordinates.
1407     *
1408     *<p>This function is derived from the International Astronomical Union's
1409     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1410     *
1411     *<p>Status:  vector/matrix support function.
1412     *
1413     *<!-- Given: -->
1414     *     @param p       double[3]     p-vector
1415     *
1416     *<!-- Returned: -->
1417     *     @return theta   double         <u>returned</u> longitude angle (radians)
1418     *             phi     double         <u>returned</u> latitude angle (radians)
1419     *
1420     * <p>Notes:
1421     * <ol>
1422     *
1423     * <li> The vector p can have any magnitude; only its direction is used.
1424     *
1425     * <li> If p is null, zero theta and phi are returned.
1426     *
1427     * <li> At either pole, zero theta is returned.
1428     *</ol>
1429     *@version 2008 May 11
1430     *
1431     *  @since Release 20101201
1432     *
1433     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1434     */
1435     public static SphericalCoordinate jauC2s(double p[])
1436     {
1437        double x, y, z, d2;
1438 
1439 
1440        x  = p[0];
1441        y  = p[1];
1442        z  = p[2];
1443        d2 = x*x + y*y;
1444 
1445        double theta = (d2 == 0.0) ? 0.0 : atan2(y, x);
1446        double phi = (z == 0.0) ? 0.0 : atan2(z, sqrt(d2));
1447 
1448        return new SphericalCoordinate(theta, phi);
1449 
1450         }
1451     
1452 
1453     /**
1454     *  Form the celestial to terrestrial matrix given the date, the UT1 and
1455     *  the polar motion, using the IAU 2000A nutation model.
1456     *
1457     *<p>This function is derived from the International Astronomical Union's
1458     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1459     *
1460     *<p>Status:  support function.
1461     *
1462     *<!-- Given: -->
1463     *     @param tta double          TT as a 2-part Julian Date (Note 1)
1464     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
1465     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
1466     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
1467     *     @param xp double          CIP coordinates (radians, Note 2)
1468     *     @param yp double          CIP coordinates (radians, Note 2) 
1469     *
1470     *<!-- Returned: -->
1471     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 3)
1472     *
1473     * <p>Notes:
1474     * <ol>
1475     *
1476     *   <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1477     *     apportioned in any convenient way between the arguments uta and
1478     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1479     *     these ways, among others:
1480     *<pre>
1481     *             uta            utb
1482     *
1483     *         2450123.7           0.0       (JD method)
1484     *         2451545.0       -1421.3       (J2000 method)
1485     *         2400000.5       50123.2       (MJD method)
1486     *         2450123.5           0.2       (date &amp;time method)
1487     *</pre>
1488     *     The JD method is the most natural and convenient to use in
1489     *     cases where the loss of several decimal digits of resolution is
1490     *     acceptable.  The J2000 and MJD methods are good compromises
1491     *     between resolution and convenience.  In the case of uta,utb, the
1492     *     date &amp;time method is best matched to the Earth rotation angle
1493     *     algorithm used:  maximum precision is delivered when the uta
1494     *     argument is for 0hrs UT1 on the day in question and the utb
1495     *     argument lies in the range 0 to 1, or vice versa.
1496     *
1497     *  <li> The arguments xp and yp are the coordinates (in radians) of the
1498     *     Celestial Intermediate Pole with respect to the International
1499     *     Terrestrial Reference System (see IERS Conventions 2003),
1500     *     measured along the meridians 0 and 90 deg west respectively.
1501     *
1502     * <li> The matrix rc2t transforms from celestial to terrestrial
1503     *     coordinates:
1504     *
1505     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
1506     *
1507     *              = rc2t * [CRS]
1508     *
1509     *     where [CRS] is a vector in the Geocentric Celestial Reference
1510     *     System and [TRS] is a vector in the International Terrestrial
1511     *     Reference System (see IERS Conventions 2003), RC2I is the
1512     *     celestial-to-intermediate matrix, ERA is the Earth rotation
1513     *     angle and RPOM is the polar motion matrix.
1514     *
1515     * <li> A faster, but slightly less accurate, result (about 1 mas), can
1516     *     be obtained by using instead the jauC2t00b function.
1517     *</ol>
1518     *<p>Called:<ul>
1519     *     <li>{@link #jauC2i00a} celestial-to-intermediate matrix, IAU 2000A
1520     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
1521     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
1522     *     <li>{@link #jauPom00} polar motion matrix
1523     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
1524     * </ul>
1525     *<p>Reference:
1526     *
1527     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1528     *     IERS Technical Note No. 32, BKG (2004)
1529     *
1530     *@version 2009 April 1
1531     *
1532     *  @since Release 20101201
1533     *
1534     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1535     */
1536     public static  double[][] jauC2t00a(final double tta, final double ttb, final double uta, final double utb,
1537                    final double xp, final double yp)
1538     {
1539        double rc2i[][]= new double[3][3], era, sp, rpom[][];
1540 
1541 
1542     /* Form the celestial-to-intermediate matrix for this TT (IAU 2000A). */
1543        rc2i = jauC2i00a(tta, ttb);
1544 
1545     /* Predict the Earth rotation angle for this UT1. */
1546        era = jauEra00(uta, utb);
1547 
1548     /* Estimate s'. */
1549        sp = jauSp00(tta, ttb);
1550 
1551     /* Form the polar motion matrix. */
1552        rpom = jauPom00(xp, yp, sp );
1553 
1554     /* Combine to form the celestial-to-terrestrial matrix. */
1555        double[][] rc2t = jauC2tcio(rc2i, era, rpom );
1556 
1557        return rc2t;
1558 
1559         }
1560     
1561 
1562     /**
1563     *  Form the celestial to terrestrial matrix given the date, the UT1 and
1564     *  the polar motion, using the IAU 2000B precession-nutation model.
1565     *
1566     *<p>This function is derived from the International Astronomical Union's
1567     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1568     *
1569     *<p>Status:  support function.
1570     *
1571     *<!-- Given: -->
1572     *     @param tta double          TT as a 2-part Julian Date (Note 1)
1573     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
1574     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
1575     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
1576     *     @param xp double          coordinates of the pole (radians, Note 2)
1577     *     @param yp double          coordinates of the pole (radians, Note 2) 
1578     *
1579     *<!-- Returned: -->
1580     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 3)
1581     *
1582     * <p>Notes:
1583     * <ol>
1584     *
1585     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1586     *     apportioned in any convenient way between the arguments uta and
1587     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1588     *     these ways, among others:
1589     *<pre>
1590     *             uta            utb
1591     *
1592     *         2450123.7           0.0       (JD method)
1593     *         2451545.0       -1421.3       (J2000 method)
1594     *         2400000.5       50123.2       (MJD method)
1595     *         2450123.5           0.2       (date &amp;time method)
1596     *</pre>
1597     *     The JD method is the most natural and convenient to use in
1598     *     cases where the loss of several decimal digits of resolution is
1599     *     acceptable.  The J2000 and MJD methods are good compromises
1600     *     between resolution and convenience.  In the case of uta,utb, the
1601     *     date &amp;time method is best matched to the Earth rotation angle
1602     *     algorithm used:  maximum precision is delivered when the uta
1603     *     argument is for 0hrs UT1 on the day in question and the utb
1604     *     argument lies in the range 0 to 1, or vice versa.
1605     *
1606     * <li> The arguments xp and yp are the coordinates (in radians) of the
1607     *     Celestial Intermediate Pole with respect to the International
1608     *     Terrestrial Reference System (see IERS Conventions 2003),
1609     *     measured along the meridians 0 and 90 deg west respectively.
1610     *
1611     * <li> The matrix rc2t transforms from celestial to terrestrial
1612     *     coordinates:
1613     *
1614     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
1615     *
1616     *              = rc2t * [CRS]
1617     *
1618     *     where [CRS] is a vector in the Geocentric Celestial Reference
1619     *     System and [TRS] is a vector in the International Terrestrial
1620     *     Reference System (see IERS Conventions 2003), RC2I is the
1621     *     celestial-to-intermediate matrix, ERA is the Earth rotation
1622     *     angle and RPOM is the polar motion matrix.
1623     *
1624     * <li> The present function is faster, but slightly less accurate (about
1625     *     1 mas), than the jauC2t00a function.
1626     *</ol>
1627     *<p>Called:<ul>
1628     *     <li>{@link #jauC2i00b} celestial-to-intermediate matrix, IAU 2000B
1629     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
1630     *     <li>{@link #jauPom00} polar motion matrix
1631     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
1632     * </ul>
1633     *<p>Reference:
1634     *
1635     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1636     *     IERS Technical Note No. 32, BKG (2004)
1637     *
1638     *@version 2009 April 1
1639     *
1640     *  @since Release 20101201
1641     *
1642     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1643     */
1644     public static double[][] jauC2t00b(final double tta, final double ttb, final double uta, final double utb,
1645                    final double xp, final double yp )
1646     {
1647        double rc2i[][], era, rpom[][];
1648        double rc2t[][];
1649 
1650     /* Form the celestial-to-intermediate matrix for this TT (IAU 2000B). */
1651        rc2i =jauC2i00b(tta, ttb);
1652 
1653     /* Predict the Earth rotation angle for this UT1. */
1654        era = jauEra00(uta, utb);
1655 
1656     /* Form the polar motion matrix (neglecting s'). */
1657        rpom = jauPom00(xp, yp, 0.0 );
1658 
1659     /* Combine to form the celestial-to-terrestrial matrix. */
1660        rc2t = jauC2tcio(rc2i, era, rpom );
1661 
1662        return rc2t;
1663 
1664         }
1665     
1666 
1667     /**
1668     *  Form the celestial to terrestrial matrix given the date, the UT1 and
1669     *  the polar motion, using the IAU 2006/2000A precession-nutation
1670     *  nutation model.
1671     *
1672     *<p>This function is derived from the International Astronomical Union's
1673     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1674     *
1675     *<p>Status:  support function.
1676     *
1677     *<!-- Given: -->
1678     *     @param tta double          TT as a 2-part Julian Date (Note 1)
1679     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
1680     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
1681     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
1682     *     @param xp double          coordinates of the pole (radians, Note 2)
1683     *     @param yp double          coordinates of the pole (radians, Note 2) 
1684     *
1685     *<!-- Returned: -->
1686     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 3)
1687     *
1688     * <p>Notes:
1689     * <ol>
1690     *
1691     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1692     *     apportioned in any convenient way between the arguments.
1693     *     For example, JD(UT1)=2450123.7 could be expressed in any of
1694     *     these ways, among others:
1695     *<pre>
1696     *             uta            utb
1697     *
1698     *         2450123.7           0.0       (JD method)
1699     *         2451545.0       -1421.3       (J2000 method)
1700     *         2400000.5       50123.2       (MJD method)
1701     *         2450123.5           0.2       (date &amp;time method)
1702     *</pre>
1703     *     The JD method is the most natural and convenient to use in
1704     *     cases where the loss of several decimal digits of resolution is
1705     *     acceptable.  The J2000 and MJD methods are good compromises
1706     *     between resolution and convenience.  In the case of uta,utb, the
1707     *     date &amp;time method is best matched to the Earth rotation angle
1708     *     algorithm used:  maximum precision is delivered when the uta
1709     *     argument is for 0hrs UT1 on the day in question and the utb
1710     *     argument lies in the range 0 to 1, or vice versa.
1711     *
1712     * <li> The arguments xp and yp are the coordinates (in radians) of the
1713     *     Celestial Intermediate Pole with respect to the International
1714     *     Terrestrial Reference System (see IERS Conventions 2003),
1715     *     measured along the meridians 0 and 90 deg west respectively.
1716     *
1717     * <li> The matrix rc2t transforms from celestial to terrestrial
1718     *     coordinates:
1719     *
1720     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
1721     *
1722     *              = rc2t * [CRS]
1723     *
1724     *     where [CRS] is a vector in the Geocentric Celestial Reference
1725     *     System and [TRS] is a vector in the International Terrestrial
1726     *     Reference System (see IERS Conventions 2003), RC2I is the
1727     *     celestial-to-intermediate matrix, ERA is the Earth rotation
1728     *     angle and RPOM is the polar motion matrix.
1729     *</ol>
1730     *<p>Called:<ul>
1731     *     <li>{@link #jauC2i06a} celestial-to-intermediate matrix, IAU 2006/2000A
1732     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
1733     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
1734     *     <li>{@link #jauPom00} polar motion matrix
1735     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
1736     * </ul>
1737     *<p>Reference:
1738     *
1739     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
1740     *     IERS Technical Note No. 32, BKG
1741     *
1742     *@version 2009 April 1
1743     *
1744     *  @since Release 20101201
1745     *
1746     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1747     */
1748     public static double[][] jauC2t06a(final double tta, final double ttb, final double uta, final double utb,
1749                   final double xp, final double yp)
1750     {
1751        double rc2i[][], era, sp, rpom[][], rc2t[][];
1752 
1753 
1754     /* Form the celestial-to-intermediate matrix for this TT. */
1755        rc2i = jauC2i06a(tta, ttb);
1756 
1757     /* Predict the Earth rotation angle for this UT1. */
1758        era = jauEra00(uta, utb);
1759 
1760     /* Estimate s'. */
1761        sp = jauSp00(tta, ttb);
1762 
1763     /* Form the polar motion matrix. */
1764        rpom = jauPom00(xp, yp, sp );
1765 
1766     /* Combine to form the celestial-to-terrestrial matrix. */
1767        rc2t = jauC2tcio(rc2i, era, rpom );
1768 
1769        return rc2t;
1770 
1771         }
1772     
1773 
1774     /**
1775     *  Assemble the celestial to terrestrial matrix from CIO-based
1776     *  components (the celestial-to-intermediate matrix, the Earth Rotation
1777     *  Angle and the polar motion matrix).
1778     *
1779     *<p>This function is derived from the International Astronomical Union's
1780     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1781     *
1782     *<p>Status:  support function.
1783     *
1784     *<!-- Given: -->
1785     *     @param rc2i      double[3][3]     celestial-to-intermediate matrix
1786     *     @param era       double           Earth rotation angle (radians)
1787     *     @param rpom      double[3][3]     polar-motion matrix
1788     *
1789     *<!-- Returned: -->
1790     *     @return rc2t      double[3][3]      <u>returned</u> celestial-to-terrestrial matrix
1791     *
1792     * <p>Notes:
1793     * <ol>
1794     *
1795     * <li> This function constructs the rotation matrix that transforms
1796     *     vectors in the celestial system into vectors in the terrestrial
1797     *     system.  It does so starting from precomputed components, namely
1798     *     the matrix which rotates from celestial coordinates to the
1799     *     intermediate frame, the Earth rotation angle and the polar motion
1800     *     matrix.  One use of the present function is when generating a
1801     *     series of celestial-to-terrestrial matrices where only the Earth
1802     *     Rotation Angle changes, avoiding the considerable overhead of
1803     *     recomputing the precession-nutation more often than necessary to
1804     *     achieve given accuracy objectives.
1805     *
1806     * <li> The relationship between the arguments is as follows:
1807     *
1808     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1809     *
1810     *              = rc2t * [CRS]
1811     *
1812     *     where [CRS] is a vector in the Geocentric Celestial Reference
1813     *     System and [TRS] is a vector in the International Terrestrial
1814     *     Reference System (see IERS Conventions 2003).
1815     *</ol>
1816     *<p>Called:<ul>
1817     *     <li>{@link #jauCr} copy r-matrix
1818     *     <li>{@link #jauRz} rotate around Z-axis
1819     *     <li>{@link #jauRxr} product of two r-matrices
1820     * </ul>
1821     *<p>Reference:
1822     *
1823     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
1824     *     IERS Technical Note No. 32, BKG
1825     *
1826     *@version 2008 May 11
1827     *
1828     *  @since Release 20101201
1829     *
1830     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1831     */
1832     public static double[][] jauC2tcio(final double rc2i[][], final double era, final double rpom[][])
1833     {
1834        double r[][] = new double[3][3];
1835 
1836 
1837     /* Construct the matrix. */
1838        jauCr(rc2i, r);
1839        jauRz(era, r);
1840        double[][] rc2t = jauRxr(rpom, r);
1841 
1842        return rc2t;
1843 
1844         }
1845     
1846 
1847     /**
1848     *  Assemble the celestial to terrestrial matrix from equinox-based
1849     *  components (the celestial-to-true matrix, the Greenwich Apparent
1850     *  Sidereal Time and the polar motion matrix).
1851     *
1852     *<p>This function is derived from the International Astronomical Union's
1853     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1854     *
1855     *<p>Status:  support function.
1856     *
1857     *<!-- Given: -->
1858     *     @param rbpn      double[3][3]     celestial-to-true matrix
1859     *     @param gst       double           Greenwich (apparent) Sidereal Time (radians)
1860     *     @param rpom      double[3][3]     polar-motion matrix
1861     *
1862     *<!-- Returned: -->
1863     *     @return rc2t      double[3][3]      <u>returned</u> celestial-to-terrestrial matrix (Note 2)
1864     *
1865     * <p>Notes:
1866     * <ol>
1867     *
1868     * <li> This function constructs the rotation matrix that transforms
1869     *     vectors in the celestial system into vectors in the terrestrial
1870     *     system.  It does so starting from precomputed components, namely
1871     *     the matrix which rotates from celestial coordinates to the
1872     *     true equator and equinox of date, the Greenwich Apparent Sidereal
1873     *     Time and the polar motion matrix.  One use of the present function
1874     *     is when generating a series of celestial-to-terrestrial matrices
1875     *     where only the Sidereal Time changes, avoiding the considerable
1876     *     overhead of recomputing the precession-nutation more often than
1877     *     necessary to achieve given accuracy objectives.
1878     *
1879     * <li> The relationship between the arguments is as follows:
1880     *
1881     *        [TRS] = rpom * R_3(gst) * rbpn * [CRS]
1882     *
1883     *              = rc2t * [CRS]
1884     *
1885     *     where [CRS] is a vector in the Geocentric Celestial Reference
1886     *     System and [TRS] is a vector in the International Terrestrial
1887     *     Reference System (see IERS Conventions 2003).
1888     *</ol>
1889     *<p>Called:<ul>
1890     *     <li>{@link #jauCr} copy r-matrix
1891     *     <li>{@link #jauRz} rotate around Z-axis
1892     *     <li>{@link #jauRxr} product of two r-matrices
1893     * </ul>
1894     *<p>Reference:
1895     *
1896     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1897     *     IERS Technical Note No. 32, BKG (2004)
1898     *
1899     *@version 2008 May 11
1900     *
1901     *  @since Release 20101201
1902     *
1903     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1904     */
1905     public static double[][] jauC2teqx(final double rbpn[][], final double gst, final double rpom[][] )
1906     {
1907        double r[][] = new double[3][3], rc2t[][];
1908 
1909 
1910     /* Construct the matrix. */
1911        jauCr(rbpn, r);
1912        jauRz(gst, r);
1913        rc2t = jauRxr(rpom, r);
1914 
1915        return rc2t;
1916 
1917         }
1918     
1919 
1920     /**
1921     *  Form the celestial to terrestrial matrix given the date, the UT1,
1922     *  the nutation and the polar motion.  IAU 2000.
1923     *
1924     *<p>This function is derived from the International Astronomical Union's
1925     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1926     *
1927     *<p>Status:  support function.
1928     *
1929     *<!-- Given: -->
1930     *     @param tta double         TT as a 2-part Julian Date (Note 1)
1931     *     @param ttb double         TT as a 2-part Julian Date (Note 1) 
1932     *     @param uta double         UT1 as a 2-part Julian Date (Note 1)
1933     *     @param utb double         UT1 as a 2-part Julian Date (Note 1) 
1934     *     @param dpsi double         nutation (Note 2)
1935     *     @param deps double         nutation (Note 2) 
1936     *     @param xp double         coordinates of the pole (radians, Note 3)
1937     *     @param yp double         coordinates of the pole (radians, Note 3) 
1938     *
1939     *<!-- Returned: -->
1940     *     @return rc2t        double[3][3]    <u>returned</u> celestial-to-terrestrial matrix (Note 4)
1941     *
1942     * <p>Notes:
1943     * <ol>
1944     *
1945     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1946     *     apportioned in any convenient way between the arguments uta and
1947     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1948     *     these ways, among others:
1949     *<pre>
1950     *             uta            utb
1951     *
1952     *         2450123.7           0.0       (JD method)
1953     *         2451545.0       -1421.3       (J2000 method)
1954     *         2400000.5       50123.2       (MJD method)
1955     *         2450123.5           0.2       (date &amp;time method)
1956     *</pre>
1957     *     The JD method is the most natural and convenient to use in
1958     *     cases where the loss of several decimal digits of resolution is
1959     *     acceptable.  The J2000 and MJD methods are good compromises
1960     *     between resolution and convenience.  In the case of uta,utb, the
1961     *     date &amp;time method is best matched to the Earth rotation angle
1962     *     algorithm used:  maximum precision is delivered when the uta
1963     *     argument is for 0hrs UT1 on the day in question and the utb
1964     *     argument lies in the range 0 to 1, or vice versa.
1965     *
1966     * <li> The caller is responsible for providing the nutation components;
1967     *     they are in longitude and obliquity, in radians and are with
1968     *     respect to the equinox and ecliptic of date.  For high-accuracy
1969     *     applications, free core nutation should be included as well as
1970     *     any other relevant corrections to the position of the CIP.
1971     *
1972     * <li> The arguments xp and yp are the coordinates (in radians) of the
1973     *     Celestial Intermediate Pole with respect to the International
1974     *     Terrestrial Reference System (see IERS Conventions 2003),
1975     *     measured along the meridians 0 and 90 deg west respectively.
1976     *
1977     * <li> The matrix rc2t transforms from celestial to terrestrial
1978     *     coordinates:
1979     *
1980     *        [TRS] = RPOM * R_3(GST) * RBPN * [CRS]
1981     *
1982     *              = rc2t * [CRS]
1983     *
1984     *     where [CRS] is a vector in the Geocentric Celestial Reference
1985     *     System and [TRS] is a vector in the International Terrestrial
1986     *     Reference System (see IERS Conventions 2003), RBPN is the
1987     *     bias-precession-nutation matrix, GST is the Greenwich (apparent)
1988     *     Sidereal Time and RPOM is the polar motion matrix.
1989     *
1990     * <li> Although its name does not include "00", This function is in fact
1991     *     specific to the IAU 2000 models.
1992     *</ol>
1993     *<p>Called:<ul>
1994     *     <li>{@link #jauPn00} bias/precession/nutation results, IAU 2000
1995     *     <li>{@link #jauGmst00} Greenwich mean sidereal time, IAU 2000
1996     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
1997     *     <li>{@link #jauEe00} equation of the equinoxes, IAU 2000
1998     *     <li>{@link #jauPom00} polar motion matrix
1999     *     <li>{@link #jauC2teqx} form equinox-based celestial-to-terrestrial matrix
2000     * </ul>
2001     *<p>Reference:
2002     *
2003     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
2004     *     IERS Technical Note No. 32, BKG (2004)
2005     *
2006     *@version 2009 April 1
2007     *
2008     *  @since Release 20101201
2009     *
2010     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2011     */
2012     public static double[][] jauC2tpe(final double tta, final double ttb, final double uta, final double utb,
2013             final double dpsi, final double deps, final double xp, final double yp)
2014     {
2015        double rpom[][]; 
2016 
2017     /* Form the celestial-to-true matrix for this TT. */
2018        PrecessionNutation pn = jauPn00(tta, ttb, dpsi, deps);
2019 
2020     /* Predict the Greenwich Mean Sidereal Time for this UT1 and TT. */
2021        double gmst = jauGmst00(uta, utb, tta, ttb);
2022 
2023     /* Predict the equation of the equinoxes given TT and nutation. */
2024        double ee = jauEe00(tta, ttb, pn.epsa, dpsi);
2025 
2026     /* Estimate s'. */
2027        double sp = jauSp00(tta, ttb);
2028 
2029     /* Form the polar motion matrix. */
2030        rpom = jauPom00(xp, yp, sp);
2031 
2032     /* Combine to form the celestial-to-terrestrial matrix. */
2033        double[][] rc2t = jauC2teqx(pn.rbpn, gmst + ee, rpom );
2034 
2035        return rc2t;
2036 
2037         }
2038     
2039 
2040     /**
2041     *  Form the celestial to terrestrial matrix given the date, the UT1,
2042     *  the CIP coordinates and the polar motion.  IAU 2000.
2043     *
2044     *<p>This function is derived from the International Astronomical Union's
2045     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2046     *
2047     *<p>Status:  support function.
2048     *
2049     *<!-- Given: -->
2050     *     @param tta double          TT as a 2-part Julian Date (Note 1)
2051     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
2052     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
2053     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
2054     *     @param x double          Celestial Intermediate Pole (Note 2)
2055     *     @param y double          Celestial Intermediate Pole (Note 2) 
2056     *     @param xp double          coordinates of the pole (radians, Note 3)
2057     *     @param yp double          coordinates of the pole (radians, Note 3) 
2058     *
2059     *<!-- Returned: -->
2060     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 4)
2061     *
2062     * <p>Notes:
2063     * <ol>
2064     *
2065     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
2066     *     apportioned in any convenient way between the arguments uta and
2067     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any o
2068     *     these ways, among others:
2069     *<pre>
2070     *             uta            utb
2071     *
2072     *         2450123.7           0.0       (JD method)
2073     *         2451545.0       -1421.3       (J2000 method)
2074     *         2400000.5       50123.2       (MJD method)
2075     *         2450123.5           0.2       (date &amp;time method)
2076     *</pre>
2077     *     The JD method is the most natural and convenient to use in
2078     *     cases where the loss of several decimal digits of resolution is
2079     *     acceptable.  The J2000 and MJD methods are good compromises
2080     *     between resolution and convenience.  In the case of uta,utb, the
2081     *     date &amp;time method is best matched to the Earth rotation angle
2082     *     algorithm used:  maximum precision is delivered when the uta
2083     *     argument is for 0hrs UT1 on the day in question and the utb
2084     *     argument lies in the range 0 to 1, or vice versa.
2085     *
2086     * <li> The Celestial Intermediate Pole coordinates are the x,y
2087     *     components of the unit vector in the Geocentric Celestial
2088     *     Reference System.
2089     *
2090     * <li> The arguments xp and yp are the coordinates (in radians) of the
2091     *     Celestial Intermediate Pole with respect to the International
2092     *     Terrestrial Reference System (see IERS Conventions 2003),
2093     *     measured along the meridians 0 and 90 deg west respectively.
2094     *
2095     * <li> The matrix rc2t transforms from celestial to terrestrial
2096     *     coordinates:
2097     *
2098     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
2099     *
2100     *              = rc2t * [CRS]
2101     *
2102     *     where [CRS] is a vector in the Geocentric Celestial Reference
2103     *     System and [TRS] is a vector in the International Terrestrial
2104     *     Reference System (see IERS Conventions 2003), ERA is the Earth
2105     *     Rotation Angle and RPOM is the polar motion matrix.
2106     *
2107     * <li> Although its name does not include "00", This function is in fact
2108     *     specific to the IAU 2000 models.
2109     *</ol>
2110     *<p>Called:<ul>
2111     *     <li>{@link #jauC2ixy} celestial-to-intermediate matrix, given X,Y
2112     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
2113     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
2114     *     <li>{@link #jauPom00} polar motion matrix
2115     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
2116     * </ul>
2117     * Reference:
2118     *
2119     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
2120     *     IERS Technical Note No. 32, BKG (2004)
2121     *
2122     *@version 2009 April 1
2123     *
2124     *  @since Release 20101201
2125     *
2126     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2127     */
2128     public static double[][] jauC2txy(double tta, double ttb, double uta, double utb,
2129                   double x, double y, double xp, double yp)
2130     {
2131        double rc2i[][] = new double[3][3], era, sp, rpom[][] = new double[3][3];
2132 
2133 
2134     /* Form the celestial-to-intermediate matrix for this TT. */
2135        rc2i = jauC2ixy(tta, ttb, x, y);
2136 
2137     /* Predict the Earth rotation angle for this UT1. */
2138        era = jauEra00(uta, utb);
2139 
2140     /* Estimate s'. */
2141        sp = jauSp00(tta, ttb);
2142 
2143     /* Form the polar motion matrix. */
2144        rpom = jauPom00(xp, yp, sp);
2145 
2146     /* Combine to form the celestial-to-terrestrial matrix. */
2147        double[][] rc2t = jauC2tcio(rc2i, era, rpom );
2148 
2149        return rc2t;
2150 
2151         }
2152     
2153     /**
2154     *  Gregorian Calendar to Julian Date.
2155     *
2156     *<p>This function is derived from the International Astronomical Union's
2157     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2158     *
2159     *<p>Status:  support function.
2160     *
2161     *<!-- Given: -->
2162     *     @param iy  int      year in Gregorian calendar (Note 1)
2163     *     @param im  int      month in Gregorian calendar (Note 1)
2164     *     @param id   int     day in Gregorian calendar (Note 1)
2165     *
2166     *<!-- Returned: -->
2167     *     @return d MJD zero-point: always 2400000.5
2168     *       <u>returned</u> Modified Julian Date for 0 hrs
2169     *
2170     * <!-- Returned (function value): -->
2171     *  @throws JSOFAIllegalParameter      status:
2172     *                           0 = OK
2173     *                          -1 = bad year   (Note 3: JD not computed)
2174     *                          -2 = bad month  (JD not computed)
2175     *                          -3 = bad day    (JD computed)
2176     *
2177     * <p>Notes:
2178     * <ol>
2179     *
2180     * <li> The algorithm used is valid from -4800 March 1, but this
2181     *     implementation rejects dates before -4799 January 1.
2182     *
2183     * <li> The Julian Date is returned in two pieces, in the usual JSOFA
2184     *     manner, which is designed to preserve time resolution.  The
2185     *     Julian Date is available as a single number by adding djm0 and
2186     *     djm.
2187     *
2188     * <li> In early eras the conversion is from the "Proleptic Gregorian
2189     *     Calendar";  no account is taken of the date(s) of adoption of
2190     *     the Gregorian Calendar, nor is the AD/BC numbering convention
2191     *     observed.
2192     *</ol>
2193     *<p>Reference:
2194     *
2195     *     <p>Explanatory Supplement to the Astronomical Almanac,
2196     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
2197     *     Section 12.92 (p604).
2198     *
2199     *@version 2009 October 19
2200     *
2201     *  @since Release 20101201
2202     *
2203     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2204     */
2205     public static JulianDate jauCal2jd(int iy, int im, int id) throws JSOFAIllegalParameter
2206     {
2207        int ly, my;
2208        long iypmy;
2209        double djm0, djm;
2210 
2211     /* Earliest year allowed (4800BC) */
2212        final int IYMIN = -4799;
2213 
2214     /* Month lengths in days */
2215        final int mtab[]
2216                          = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
2217 
2218 
2219     /* Validate year and month. */
2220        if (iy < IYMIN) throw new JSOFAIllegalParameter("bad year", -1);
2221        if (im < 1 || im > 12) throw new JSOFAIllegalParameter("bad month", -2);
2222 
2223     /* If February in a leap year, 1, otherwise 0. */
2224        ly = ((im == 2) &&(iy%4 == 0) && (iy%100 != 0 || (iy%400 == 0)))?1:0;
2225 
2226     /* Validate day, taking into account leap years. */
2227        if ( (id < 1) || (id > (mtab[im-1] + ly))) {
2228     }
2229 
2230     /* Return result. */
2231        my = (im - 14) / 12;
2232        iypmy = (long) (iy + my);
2233        djm0 = DJM0;
2234        djm = (double)((1461L * (iypmy + 4800L)) / 4L
2235                      + (367L * (long) (im - 2 - 12 * my)) / 12L
2236                      - (3L * ((iypmy + 4900L) / 100L)) / 4L
2237                      + (long) id - 2432076L);
2238 
2239     /* Return status. */
2240        return new JulianDate(djm0, djm);
2241 
2242         }
2243     
2244 
2245     /**
2246     *  Copy a p-vector.
2247     *
2248     *<p>This function is derived from the International Astronomical Union's
2249     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2250     *
2251     *<p>Status:  vector/matrix support function.
2252     *
2253     *<!-- Given: -->
2254     *     @param p         double[3]      p-vector to be copied
2255     *
2256     *<!-- Returned: -->
2257     *     @param c         double[3]       <u>given and returned</u> copy
2258     *     @return  double[3]       <u>given and returned</u> copy
2259     *
2260     *@version 2008 May 11
2261     *
2262     *  @since Release 20101201
2263     *
2264     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2265     */
2266     public static double[] jauCp(double p[], double c[])
2267     {
2268        
2269        c[0] = p[0];
2270        c[1] = p[1];
2271        c[2] = p[2];
2272 
2273        return c;
2274 
2275     }
2276     
2277 
2278     /**
2279     *  Copy a position/velocity vector.
2280     *
2281     *<p>This function is derived from the International Astronomical Union's
2282     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2283     *
2284     *<p>Status:  vector/matrix support function.
2285     *
2286     *<!-- Given: -->
2287     *     @param pv      double[2][3]     position/velocity vector to be copied
2288     *     @param c       double[2][3]      <u>returned</u> copy
2289     *
2290     *<!-- Returned: -->
2291     *     @return        double[2][3]      <u>returned c</u> copy
2292     *
2293     *<p>Called:<ul>
2294     *     <li>{@link #jauCp} copy p-vector
2295     * </ul>
2296     *@version 2008 May 11
2297     *
2298     *  @since Release 20101201
2299     *
2300     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2301     */
2302     public static double[][] jauCpv(double pv[][],  double c[][])
2303     {
2304 
2305         c[0]=jauCp(pv[0], c[0]);
2306         c[1]=jauCp(pv[1], c[1]);
2307 
2308        return c;
2309 
2310         }
2311     
2312 
2313     /**
2314     *  Copy an r-matrix.
2315     *
2316     *<p>This function is derived from the International Astronomical Union's
2317     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2318     *
2319     *<p>Status:  vector/matrix support function.
2320     *
2321     *<!-- Given: -->
2322     *     @param r         double[3][3]     r-matrix to be copied.
2323     *
2324     *<!-- Returned: -->
2325     *   @param c      double[3][3]      <u>given and returned</u> the elements of r are copied into this.
2326     *
2327     *<p>Called:<ul>
2328     *     <li>{@link #jauCp} copy p-vector
2329     * </ul>
2330     *@version 2008 May 11
2331     *
2332     *  @since Release 20101201
2333     *
2334     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2335     */
2336     public static void jauCr(double r[][], double c[][] )
2337     {
2338 
2339        jauCp(r[0], c[0]);
2340        jauCp(r[1], c[1]);
2341        jauCp(r[2], c[2]);
2342 
2343        return;
2344 
2345         }
2346     
2347 
2348     /**
2349     *  Decompose days to hours, minutes, seconds, fraction.
2350     *
2351     *<p>This function is derived from the International Astronomical Union's
2352     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2353     *
2354     *<p>Status:  vector/matrix support function.
2355     *
2356     *<!-- Given: -->
2357     *     @param ndp      int      resolution (Note 1)
2358     *     @param days     double   interval in days
2359     *
2360     *<!-- Returned: -->
2361     *     @param ihmsf    int[4]    <u>returned</u> hours, minutes, seconds, fraction
2362     *     @return sign     char      <u>returned</u> '+' or '-'
2363     *
2364     * <p>Notes:
2365     * <ol>
2366     *
2367     * <li> The argument ndp is interpreted as follows:
2368     *
2369     *     ndp         resolution
2370     *      :      ...0000 00 00
2371     *     -7         1000 00 00
2372     *     -6          100 00 00
2373     *     -5           10 00 00
2374     *     -4            1 00 00
2375     *     -3            0 10 00
2376     *     -2            0 01 00
2377     *     -1            0 00 10
2378     *      0            0 00 01
2379     *      1            0 00 00.1
2380     *      2            0 00 00.01
2381     *      3            0 00 00.001
2382     *      :            0 00 00.000...
2383     *
2384     * <li> The largest positive useful value for ndp is determined by the
2385     *     size of days, the format of double on the target platform, and
2386     *     the risk of overflowing ihmsf[3].  On a typical platform, for
2387     *     days up to 1.0, the available floating-point precision might
2388     *     correspond to ndp=12.  However, the practical limit is typically
2389     *     ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
2390     *     only 16 bits.
2391     *
2392     * <li> The absolute value of days may exceed 1.0.  In cases where it
2393     *     does not, it is up to the caller to test for and handle the
2394     *     case where days is very nearly 1.0 and rounds up to 24 hours,
2395     *     by testing for ihms[0]=24 and setting ihmsf[1-3] to zero.
2396     *</ol>
2397     *@version 2008 May 11
2398     *
2399     *  @since Release 20101201
2400     *
2401     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2402     */
2403    public static char jauD2tf(final int ndp, final double days, int ihmsf[])
2404     {
2405        int nrs, n;
2406        double rs, rm, rh, a, w, ah, am, as, af;
2407 
2408 
2409     /* Handle sign. */
2410       char sign = (char) ( ( days >= 0.0 ) ? '+' : '-' );
2411 
2412     /* Interval in seconds. */
2413        a = DAYSEC * abs(days);
2414 
2415     /* Pre-round if resolution coarser than 1s (then pretend ndp=1). */
2416        if (ndp < 0) {
2417           nrs = 1;
2418           for (n = 1; n <= -ndp; n++) {
2419               nrs *= (n == 2 || n == 4) ? 6 : 10;
2420           }
2421           rs = (double) nrs;
2422           w = a / rs;
2423           a = rs * dnint(w);
2424        }
2425 
2426     /* Express the unit of each field in resolution units. */
2427        nrs = 1;
2428        for (n = 1; n <= ndp; n++) {
2429           nrs *= 10;
2430        }
2431        rs = (double) nrs;
2432        rm = rs * 60.0;
2433        rh = rm * 60.0;
2434 
2435     /* Round the interval and express in resolution units. */
2436        a = dnint(rs * a);
2437 
2438     /* Break into fields. */
2439        ah = a / rh;
2440        ah = dint(ah);
2441        a -= ah * rh;
2442        am = a / rm;
2443        am = dint(am);
2444        a -= am * rm;
2445        as = a / rs;
2446        as = dint(as);
2447        af = a - as * rs;
2448 
2449     /* Return results. */
2450        ihmsf[0] = (int) ah;
2451        ihmsf[1] = (int) am;
2452        ihmsf[2] = (int) as;
2453        ihmsf[3] = (int) af;
2454 
2455        return sign;
2456 
2457         }
2458  
2459    /**
2460     * Representation of Gregorian Calendar with fractional day.
2461     * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
2462     * 
2463     * @since AIDA Stage 1
2464     */
2465    public static class Calendar {
2466        public final int iy;
2467        public final int im;
2468        public final int id;
2469        public final double fd;
2470        public Calendar (int iy, int im, int id, double fd)
2471        {
2472            this.iy = iy;
2473            this.im = im;
2474            this.id = id;
2475            this.fd = fd;
2476        }
2477    }
2478 
2479    /**
2480     * Representation of Gregorian Calendar with integer hours minutes and seconds.
2481     * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
2482     * 
2483     * @since AIDA Stage 1
2484     */
2485    public static class CalendarHMS {
2486        public final int iy;
2487        public final int im;
2488        public final int id;
2489        public final int ihmsf[];
2490        public CalendarHMS (int iy, int im, int id, int hmsf[]){
2491            this.iy = iy;
2492            this.im = im;
2493            this.id = id;
2494            this.ihmsf = hmsf;
2495        }
2496    }
2497    
2498 /**
2499 *
2500 *  Format for output a 2-part Julian Date (or in the case of UTC a
2501 *  quasi-JD form that includes special provision for leap seconds).
2502 *
2503 *<p>This function is derived from the International Astronomical Union's
2504 *  SOFA (Standards of Fundamental Astronomy) software collection.
2505 *
2506 *<p>Status:  support function.
2507 *
2508 *<!-- Given: -->
2509 *     @param scale     char[]  time scale ID (Note 1)
2510 *     @param ndp       int     resolution (Note 2)
2511 *     @param d1     double  time as a 2-part Julian Date (Notes 3,4)
2512 *     @param d2     double  time as a 2-part Julian Date (Notes 3,4)
2513 *
2514 *<!-- Returned:-->
2515 *   @return the date as a Gregorian calendar
2516 *     iy,im,id  int     year, month, day in Gregorian calendar (Note 5)
2517 *     ihmsf     int[4]  hours, minutes, seconds, fraction (Note 1)
2518 *
2519 *  Returned (function value):
2520 *               int     status: +1 = dubious year (Note 5)
2521 *                                0 = OK
2522 *                               -1 = unacceptable date (Note 6)
2523 *
2524 *<p>Notes:
2525 *<ol>
2526 * <li> scale identifies the time scale.  Only the value "UTC" (in upper
2527 *     case) is significant, and enables handling of leap seconds (see
2528 *     Note 4).
2529 *
2530 * <li> ndp is the number of decimal places in the seconds field, and can
2531 *     have negative as well as positive values, such as:
2532 *
2533 *     ndp         resolution
2534 *     -4            1 00 00
2535 *     -3            0 10 00
2536 *     -2            0 01 00
2537 *     -1            0 00 10
2538 *      0            0 00 01
2539 *      1            0 00 00.1
2540 *      2            0 00 00.01
2541 *      3            0 00 00.001
2542 *
2543 *     The limits are platform dependent, but a safe range is -5 to +9.
2544 *
2545 * <li> d1+d2 is Julian Date, apportioned in any convenient way between
2546 *     the two arguments, for example where d1 is the Julian Day Number
2547 *     and d2 is the fraction of a day.  In the case of UTC, where the
2548 *     use of JD is problematical, special conventions apply:  see the
2549 *     next note.
2550 *
2551 * <li> JD cannot unambiguously represent UTC during a leap second unless
2552 *     special measures are taken.  The SOFA internal convention is that
2553 *     the quasi-JD day represents UTC days whether the length is 86399,
2554 *     86400 or 86401 SI seconds.  In the 1960-1972 era there were
2555 *     smaller jumps (in either direction) each time the linear UTC(TAI)
2556 *     expression was changed, and these "mini-leaps" are also included
2557 *     in the SOFA convention.
2558 *
2559 * <li> The warning status "dubious year" flags UTCs that predate the
2560 *     introduction of the time scale or that are too far in the future
2561 *     to be trusted.  See iauDat for further details.
2562 *
2563 * <li> For calendar conventions and limitations, see iauCal2jd.
2564 *</ol>
2565 *  Called:
2566 *     iauJd2cal    JD to Gregorian calendar
2567 *     iauD2tf      decompose days to hms
2568 *     iauDat       delta(AT) = TAI-UTC
2569 *
2570 *@version 2014 February 15
2571 *
2572 *@since JSOFA release 20131202
2573 *
2574 *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
2575  * @throws JSOFAInternalError an internal error has occured
2576  * @throws JSOFAIllegalParameter unacceptable date (notes 5,6)
2577 */
2578 public static CalendarHMS jauD2dtf(final String scale, int ndp, double d1, double d2 ) throws JSOFAIllegalParameter, JSOFAInternalError
2579 {
2580  boolean leap;
2581  int iy1, im1, id1, iy2, im2, id2, ihmsf1[] = new int[4];
2582  double a1, b1, fd, dat0, dat12, dat24, dleap;
2583 
2584 
2585 /* The two-part JD. */
2586  a1 = d1;
2587  b1 = d2;
2588 
2589 /* Provisional calendar date. */
2590  Calendar cal = jauJd2cal(a1, b1);
2591  iy1 = cal.iy;
2592  im1 = cal.im;
2593  id1 = cal.id;
2594  fd = cal.fd;
2595 
2596 /* Is this a leap second day? */
2597  leap = false;
2598  if ( scale.equalsIgnoreCase("UTC") ) {
2599 
2600  /* TAI-UTC at 0h today. */
2601      dat0 = jauDat(iy1, im1, id1, 0.0 );
2602 
2603  /* TAI-UTC at 12h today (to detect drift). */
2604      dat12 = jauDat(iy1, im1, id1, 0.5);
2605 
2606  /* TAI-UTC at 0h tomorrow (to detect jumps). */
2607     cal = jauJd2cal(a1+1.5, b1-fd);
2608     iy2 = cal.iy;
2609     im2 = cal.im;
2610     id2 = cal.id;
2611     dat24 = jauDat(iy2, im2, id2, 0.0);
2612 
2613  /* Any sudden change in TAI-UTC (seconds). */
2614     dleap = dat24 - (2.0*dat12 - dat0);
2615 
2616  /* If leap second day, scale the fraction of a day into SI. */
2617     leap = (abs(dleap) > 0.5);
2618     if (leap) fd += fd * dleap/DAYSEC;
2619  }
2620 
2621 jauD2tf ( ndp, fd, ihmsf1 );
2622 
2623 /* Has the (rounded) time gone past 24h? */
2624  if ( ihmsf1[0] > 23 ) {
2625 
2626  /* Yes.  We probably need tomorrow's calendar date. */
2627     cal = jauJd2cal(a1+1.5, b1-fd);
2628     iy2 = cal.iy; im2 = cal.im; id2 = cal.id; 
2629     
2630  /* Is today a leap second day? */
2631     if ( ! leap ) {
2632 
2633     /* No.  Use 0h tomorrow. */
2634        iy1 = iy2;
2635        im1 = im2;
2636        id1 = id2;
2637        ihmsf1[0] = 0;
2638        ihmsf1[1] = 0;
2639        ihmsf1[2] = 0;
2640 
2641     } else {
2642 
2643     /* Yes.  Are we past the leap second itself? */
2644        if ( ihmsf1[2] > 0 ) {
2645 
2646        /* Yes.  Use tomorrow but allow for the leap second. */
2647           iy1 = iy2;
2648           im1 = im2;
2649           id1 = id2;
2650           ihmsf1[0] = 0;
2651           ihmsf1[1] = 0;
2652           ihmsf1[2] = 0;
2653 
2654        } else {
2655 
2656        /* No.  Use 23 59 60... today. */
2657           ihmsf1[0] = 23;
2658           ihmsf1[1] = 59;
2659           ihmsf1[2] = 60;
2660        }
2661 
2662     /* If rounding to 10s or coarser always go up to new day. */
2663        if ( ndp < 0 && ihmsf1[2] == 60 ) {
2664           iy1 = iy2;
2665           im1 = im2;
2666           id1 = id2;
2667           ihmsf1[0] = 0;
2668           ihmsf1[1] = 0;
2669           ihmsf1[2] = 0;
2670        }
2671     }
2672  }
2673 
2674 /* Results. */
2675  
2676  return new CalendarHMS(iy1, im1, id1, ihmsf1);
2677 
2678 }   
2679 
2680 /**
2681 *  Encode date and time fields into 2-part Julian Date (or in the case
2682 *  of UTC a quasi-JD form that includes special provision for leap
2683 *  seconds).
2684 *
2685 *<p>This function is derived from the International Astronomical Union's
2686 *  SOFA (Standards of Fundamental Astronomy) software collection.
2687 *
2688 *  <p>Status:  support function.
2689 *
2690 * <!-- Given: -->
2691 *    @param scale     char  time scale ID (Note 1)
2692 *    @param iy  int     year in Gregorian calendar (Note 2)
2693 *    @param im   int    month in Gregorian calendar (Note 2)
2694 *    @param id  int      day in Gregorian calendar (Note 2)
2695 *    @param ihr  int     hour
2696 *    @param imn   int    minute
2697 *    @param sec       double  seconds
2698 *
2699 * <!-- Returned: -->
2700 *     @return     2-part Julian Date (Notes 3,4)
2701 *
2702 * @throws JSOFAIllegalParameter bad year
2703 * 
2704 * @throws JSOFAInternalError          {@code    status: +3 = both of next two
2705 *                               +2 = time is after end of day (Note 5)
2706 *                               +1 = dubious year (Note 6)
2707 *                                0 = OK
2708 *                               -1 = bad year
2709 *                               -2 = bad month
2710 *                               -3 = bad day
2711 *                               -4 = bad hour
2712 *                               -5 = bad minute
2713 *                               -6 = bad second (<0)}
2714 *
2715 *<p>Notes:
2716 *<ol>
2717 * <li> scale identifies the time scale.  Only the value "UTC" (in upper
2718 *     case) is significant, and enables handling of leap seconds (see
2719 *     Note 4).
2720 *
2721 * <li> For calendar conventions and limitations, see iauCal2jd.
2722 *
2723 * <li> The sum of the results, d1+d2, is Julian Date, where normally d1
2724 *     is the Julian Day Number and d2 is the fraction of a day.  In the
2725 *     case of UTC, where the use of JD is problematical, special
2726 *     conventions apply:  see the next note.
2727 *
2728 * <li> JD cannot unambiguously represent UTC during a leap second unless
2729 *     special measures are taken.  The SOFA internal convention is that
2730 *     the quasi-JD day represents UTC days whether the length is 86399,
2731 *     86400 or 86401 SI seconds.  In the 1960-1972 era there were
2732 *     smaller jumps (in either direction) each time the linear UTC(TAI)
2733 *     expression was changed, and these "mini-leaps" are also included
2734 *     in the SOFA convention.
2735 *
2736 * <li> The warning status "time is after end of day" usually means that
2737 *     the sec argument is greater than 60.0.  However, in a day ending
2738 *     in a leap second the limit changes to 61.0 (or 59.0 in the case
2739 *     of a negative leap second).
2740 *
2741 * <li> The warning status "dubious year" flags UTCs that predate the
2742 *     introduction of the time scale or that are too far in the future
2743 *     to be trusted.  See iauDat for further details.
2744 *
2745 * <li> Only in the case of continuous and regular time scales (TAI, TT,
2746 *     TCG, TCB and TDB) is the result d1+d2 a Julian Date, strictly
2747 *     speaking.  In the other cases (UT1 and UTC) the result must be
2748 *     used with circumspection;  in particular the difference between
2749 *     two such results cannot be interpreted as a precise time
2750 *     interval.
2751 *</ol>
2752 *  Called:
2753 *     iauCal2jd    Gregorian calendar to JD
2754 *     iauDat       delta(AT) = TAI-UTC
2755 *     iauJd2cal    JD to Gregorian calendar
2756 *
2757 *@version 2013 July 26
2758 *
2759 *@since JSOFA release 20131202
2760 *
2761 *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
2762 */
2763 public static JulianDate jauDtf2d(final String scale, int iy, int im, int id,
2764         int ihr, int imn, double sec) throws JSOFAIllegalParameter, JSOFAInternalError
2765 {
2766 int js = 0, iy2, im2, id2;
2767 double dj, w, day, seclim, dat0, dat12, dat24, dleap, time;
2768 
2769 
2770 /* Today's Julian Day Number. */
2771 JulianDate jd = jauCal2jd(iy, im, id);
2772 dj = jd.djm0; w = jd.djm1;
2773 dj += w;
2774 
2775 /* Day length and final minute length in seconds (provisional). */
2776 day = DAYSEC;
2777 seclim = 60.0;
2778 
2779 /* Deal with the UTC leap second case. */
2780 if (  scale.equals("UTC") ) {
2781 
2782 /* TAI-UTC at 0h today. */
2783     dat0 = jauDat(iy, im, id, 0.0);
2784 
2785 /* TAI-UTC at 12h today (to detect drift). */
2786     dat12 = jauDat(iy, im, id, 0.5);
2787 
2788 /* TAI-UTC at 0h tomorrow (to detect jumps). */
2789  Calendar cal = jauJd2cal ( dj, 1.5);
2790  iy2 = cal.iy; im2 = cal.im; id2 = cal.id; w = cal.fd;
2791  
2792  dat24 = jauDat(iy2, im2, id2, 0.0);
2793 
2794 /* Any sudden change in TAI-UTC between today and tomorrow. */
2795  dleap = dat24 - (2.0*dat12 - dat0);
2796 
2797 /* If leap second day, correct the day and final minute lengths. */
2798  day += dleap;
2799  if ( ihr == 23 && imn == 59 ) seclim += dleap;
2800 
2801 /* End of UTC-specific actions. */
2802 }
2803 
2804 /* Validate the time. */
2805 if ( ihr >= 0 && ihr <= 23 ) {
2806  if ( imn >= 0 && imn <= 59 ) {
2807     if ( sec >= 0 ) {
2808        if ( sec >= seclim ) {
2809           js += 2;
2810        }
2811     } else {
2812        js = -6;
2813     }
2814  } else {
2815     js = -5;
2816  }
2817 } else {
2818  js = -4;
2819 }
2820 if ( js < 0 ) throw new JSOFAInternalError("problem with time", js);
2821 
2822 /* The time in days. */
2823 time  = ( 60.0 * ( (double) ( 60 * ihr + imn ) ) + sec ) / day;
2824 
2825 /* Return the date and time. */
2826 return new JulianDate(dj, time) ;
2827 
2828 }
2829 
2830 /**
2831  * the date of the last leap second. Note that this is not a SOFA standard fumction.
2832  * @return the {@link JulianDate} of the last leap second.
2833  */
2834 public static JulianDate lastLeapSecondDate()
2835 {
2836     final LeapInfo lastentry = leapSeconds[leapSeconds.length -1];
2837     JulianDate retval = new JulianDate(0, 0);
2838     try {
2839         retval = jauCal2jd(lastentry.iyear,lastentry.month,1);
2840     } catch (JSOFAIllegalParameter e) {
2841         //should not happen
2842          e.printStackTrace();
2843     }
2844     return retval;
2845     
2846 }
2847  
2848 
2849     /**
2850     *  For a given UTC date, calculate delta(AT) = TAI-UTC.
2851     *<pre>
2852     *     :------------------------------------------:
2853     *     :                                          :
2854     *     :                 IMPORTANT                :
2855     *     :                                          :
2856     *     :  A new version of this function must be  :
2857     *     :  produced whenever a new leap second is  :
2858     *     :  announced.  There are four items to     :
2859     *     :  change on each such occasion:           :
2860     *     :                                          :
2861     *     :  1) A new line must be added to the set  :
2862     *     :     of statements that initialize the    :
2863     *     :     array "changes".                     :
2864     *     :                                          :
2865     *     :  2) The parameter IYV must be set to     :
2866     *     :     the current year.                    :
2867     *     :                                          :
2868     *     :  3) The "Latest leap second" comment     :
2869     *     :     below must be set to the new leap    :
2870     *     :     second date.                         :
2871     *     :                                          :
2872     *     :  4) The "This revision" comment, later,  :
2873     *     :     must be set to the current date.     :
2874     *     :                                          :
2875     *     :  Change (2) must also be carried out     :
2876     *     :  whenever the function is re-issued,     :
2877     *     :  even if no leap seconds have been       :
2878     *     :  added.                                  :
2879     *     :                                          :
2880     *     :  Latest leap second:  2017 Jan 01        :
2881     *     :                                          :
2882     *     :__________________________________________:
2883     *</pre>
2884     *<p>This function is derived from the International Astronomical Union's
2885     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2886     *
2887     *<p>Status:  support function.
2888     *
2889     *<!-- Given: -->
2890     *     @param iy      int       UTC:  year (Notes 1 and 2)
2891     *     @param im      int             month (Note 2)
2892     *     @param id      int             day (Notes 2 and 3)
2893     *     @param fd      double          fraction of day (Note 4)
2894     *
2895     *<!-- Returned: -->
2896     *     @return deltat  double     <u>returned</u> TAI minus UTC, seconds
2897     *
2898     *  @throws     JSOFAIllegalParameter   status (Note 5):
2899     *                       1 = dubious year (Note 1)
2900     *                       0 = OK
2901     *                      -1 = bad year
2902     *                      -2 = bad month
2903     *                      -3 = bad day (Note 3)
2904     *                      -4 = bad fraction (Note 4)
2905     *                      
2906     * @throws JSOFAInternalError
2907     *
2908     * <p>Notes:
2909     * <ol>
2910     *
2911     * <li> UTC began at 1960 January 1.0 (JD 2436934.5) and it is improper
2912     *     to call the function with an earlier date.  If this is attempted,
2913     *     zero is returned together with a warning status.
2914     *
2915     *     Because leap seconds cannot, in principle, be predicted in
2916     *     advance, a reliable check for dates beyond the valid range is
2917     *     impossible.  To guard against gross errors, a year five or more
2918     *     after the release year of the present function (see parameter
2919     *     IYV) is considered dubious.  In this case a warning status is
2920     *     returned but the result is computed in the normal way.
2921     *
2922     *     For both too-early and too-late years, the warning status is
2923     *     j=+1.  This is distinct from the error status j=-1, which
2924     *     signifies a year so early that JD could not be computed.
2925     *
2926     * <li> If the specified date is for a day which ends with a leap second,
2927     *     the TAI-UTC value returned is for the period leading up to the
2928     *     leap second.  If the date is for a day which begins as a leap
2929     *     second ends, the TAI-UTC returned is for the period following the
2930     *     leap second.
2931     *
2932     * <li> The day number must be in the normal calendar range, for example
2933     *     1 through 30 for April.  The "almanac" convention of allowing
2934     *     such dates as January 0 and December 32 is not supported in this
2935     *     function, in order to avoid confusion near leap seconds.
2936     *
2937     * <li> The fraction of day is used only for dates before the
2938     *     introduction of leap seconds, the first of which occurred at the
2939     *     end of 1971.  It is tested for validity (zero to less than 1 is
2940     *     the valid range) even if not used;  if invalid, zero is used and
2941     *     status j=-4 is returned.  For many applications, setting fd to
2942     *     zero is acceptable;  the resulting error is always less than 3 ms
2943     *     (and occurs only pre-1972).
2944     *
2945     * <li> The status value returned in the case where there are multiple
2946     *     errors refers to the first error detected.  For example, if the
2947     *     month and day are 13 and 32 respectively, j=-2 (bad month)
2948     *     will be returned.
2949     *
2950     * <li> In cases where a valid result is not available, zero is returned.
2951     *
2952     *<p>References:
2953     *
2954     * <li> For dates from 1961 January 1 onwards, the expressions from the
2955     *     file ftp://maia.usno.navy.mil/ser7/tai-utc.dat are used.
2956     *
2957     * <li> The 5ms timestep at 1961 January 1 is taken from 2.58.1 (p87) of
2958     *     the 1992 Explanatory Supplement.
2959     *</ol>
2960     *<p>Called:<ul>
2961     *     <li>{@link #jauCal2jd} Gregorian calendar to Julian Day number
2962     * </ul>
2963     *<p>@version 20160729
2964     *
2965     *  @since Release 20101201
2966     *
2967     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2968     */
2969     public static double jauDat(int iy, int im, int id, double fd ) throws JSOFAIllegalParameter, JSOFAInternalError
2970     {
2971 
2972     /* Reference dates (MJD) and drift rates (s/day), pre leap seconds */
2973       final double drift[][] = {
2974           { 37300.0, 0.0012960 },
2975           { 37300.0, 0.0012960 },
2976           { 37300.0, 0.0012960 },
2977           { 37665.0, 0.0011232 },
2978           { 37665.0, 0.0011232 },
2979           { 38761.0, 0.0012960 },
2980           { 38761.0, 0.0012960 },
2981           { 38761.0, 0.0012960 },
2982           { 38761.0, 0.0012960 },
2983           { 38761.0, 0.0012960 },
2984           { 38761.0, 0.0012960 },
2985           { 38761.0, 0.0012960 },
2986           { 39126.0, 0.0025920 },
2987           { 39126.0, 0.0025920 }
2988        };
2989 
2990     /* Number of Delta(AT) expressions before leap seconds were introduced */
2991     final int NERA1 = drift.length;
2992 
2993 
2994     /* Number of Delta(AT) changes */
2995        final int NDAT = leapSeconds.length;
2996 
2997     /* Miscellaneous local variables */
2998        int i, m;
2999        double da, djm;
3000 
3001 
3002     /* Initialize the result to zero. */
3003        double deltat = da = 0.0;
3004 
3005     /* If invalid fraction of a day, set error status and give up. */
3006        if (fd < 0.0 || fd > 1.0) throw new JSOFAIllegalParameter("bad day fraction", -4);
3007 
3008     /* Convert the date into an MJD. */
3009        JulianDate jd = jauCal2jd(iy, im, id);
3010        djm = jd.djm1;
3011 
3012     /* If pre-UTC year, set warning status and give up. */ 
3013        if (iy < leapSeconds[0].iyear) throw new JSOFAInternalError("year before UTC start", 1);
3014 
3015     /* If suspiciously late year, set warning status but proceed. */
3016        if (iy > IYV + 5) {
3017     }
3018 
3019     /* Combine year and month to form a date-ordered integer... */
3020        m = 12*iy + im;
3021 
3022     /* ...and use it to find the preceding table entry. */
3023        for (i = NDAT-1; i >=0; i--) {
3024           if (m >= (12 * leapSeconds[i].iyear + leapSeconds[i].month)) break;
3025        }
3026 
3027     /* Get the Delta(AT). */
3028        da = leapSeconds[i].delat;
3029 
3030     /* If pre-1972, adjust for drift. */
3031        if (i < NERA1) da += (djm + fd - drift[i][0]) * drift[i][1];
3032 
3033     /* Return the Delta(AT) value. */
3034        deltat = da;
3035 
3036     /* Return the value. */
3037        return deltat;
3038 
3039         }
3040     
3041 
3042     /**
3043     *  An approximation to TDB-TT, the difference between barycentric
3044     *  dynamical time and terrestrial time, for an observer on the Earth.
3045     *
3046     *  The different time scales - proper, coordinate and realized - are
3047     *  related to each other:
3048     *  {@code
3049     *            TAI             <-  physically realized
3050     *             :
3051     *          offset            <-  observed (nominally +32.184s)
3052     *             :
3053     *            TT              <-  terrestrial time
3054     *             :
3055     *    rate adjustment (L_G)   <-  definition of TT
3056     *             :
3057     *            TCG             <-  time scale for GCRS
3058     *             :
3059     *      "periodic" terms      <-  jauDtdb  is an implementation
3060     *             :
3061     *    rate adjustment (L_C)   <-  function of solar-system ephemeris
3062     *             :
3063     *            TCB             <-  time scale for BCRS
3064     *             :
3065     *    rate adjustment (-L_B)  <-  definition of TDB
3066     *             :
3067     *            TDB             <-  TCB scaled to track TT
3068     *             :
3069     *      "periodic" terms      <-  -jau_DTDB is an approximation
3070     *             :
3071     *            TT              <-  terrestrial time
3072     *}
3073     *  Adopted values for the various constants can be found in the IERS
3074     *  Conventions (McCarthy &amp; Petit 2003).
3075     *
3076     *<p>This function is derived from the International Astronomical Union's
3077     *  SOFA (Standards Of Fundamental Astronomy) software collection.
3078     *
3079     *<p>Status:  canonical model.
3080     *
3081     *<!-- Given: -->
3082     *     @param date1 double   date, TDB (Notes 1-3)
3083     *     @param date2 double   date, TDB (Notes 1-3) 
3084     *     @param ut             double   universal time (UT1, fraction of one day)
3085     *     @param elong          double   longitude (east positive, radians)
3086     *     @param u              double   distance from Earth spin axis (km)
3087     *     @param v              double   distance north of equatorial plane (km)
3088     *
3089     * <!-- Returned (function value): -->
3090     *  @return            double  TDB-TT (seconds)
3091     *
3092     * <p>Notes:
3093     * <ol>
3094     *
3095     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
3096     *     convenient way between the two arguments.  For example,
3097     *     JD(TT)=2450123.7 could be expressed in any of these ways,
3098     *     among others:
3099     *<pre>
3100     *            date1          date2
3101     *
3102     *         2450123.7           0.0       (JD method)
3103     *         2451545.0       -1421.3       (J2000 method)
3104     *         2400000.5       50123.2       (MJD method)
3105     *         2450123.5           0.2       (date &amp; time method)
3106     *</pre>
3107     *     The JD method is the most natural and convenient to use in
3108     *     cases where the loss of several decimal digits of resolution
3109     *     is acceptable.  The J2000 method is best matched to the way
3110     *     the argument is handled internally and will deliver the
3111     *     optimum resolution.  The MJD method and the date &amp; time methods
3112     *     are both good compromises between resolution and convenience.
3113     *
3114     *     Although the date is, formally, barycentric dynamical time (TDB),
3115     *     the terrestrial dynamical time (TT) can be used with no practical
3116     *     effect on the accuracy of the prediction.
3117     *
3118     * <li> TT can be regarded as a coordinate time that is realized as an
3119     *     offset of 32.184s from International Atomic Time, TAI.  TT is a
3120     *     specific linear transformation of geocentric coordinate time TCG,
3121     *     which is the time scale for the Geocentric Celestial Reference
3122     *     System, GCRS.
3123     *
3124     * <li> TDB is a coordinate time, and is a specific linear transformation
3125     *     of barycentric coordinate time TCB, which is the time scale for
3126     *     the Barycentric Celestial Reference System, BCRS.
3127     *
3128     * <li> The difference TCG-TCB depends on the masses and positions of the
3129     *     bodies of the solar system and the velocity of the Earth.  It is
3130     *     dominated by a rate difference, the residual being of a periodic
3131     *     character.  The latter, which is modeled by the present function,
3132     *     comprises a main (annual) sinusoidal term of amplitude
3133     *     approximately 0.00166 seconds, plus planetary terms up to about
3134     *     20 microseconds, and lunar and diurnal terms up to 2 microseconds.
3135     *     These effects come from the changing transverse Doppler effect
3136     *     and gravitational red-shift as the observer (on the Earth's
3137     *     surface) experiences variations in speed (with respect to the
3138     *     BCRS) and gravitational potential.
3139     *
3140     * <li> TDB can be regarded as the same as TCB but with a rate adjustment
3141     *     to keep it close to TT, which is convenient for many applications.
3142     *     The history of successive attempts to define TDB is set out in
3143     *     Resolution 3 adopted by the IAU General Assembly in 2006, which
3144     *     defines a fixed TDB(TCB) transformation that is consistent with
3145     *     contemporary solar-system ephemerides.  Future ephemerides will
3146     *     imply slightly changed transformations between TCG and TCB, which
3147     *     could introduce a linear drift between TDB and TT;  however, any
3148     *     such drift is unlikely to exceed 1 nanosecond per century.
3149     *
3150     * <li> The geocentric TDB-TT model used in the present function is that of
3151     *     Fairhead &amp; Bretagnon (1990), in its full form.  It was originally
3152     *     supplied by Fairhead (private communications with P.T.Wallace,
3153     *     1990) as a Fortran subroutine.  The present C function contains an
3154     *     adaptation of the Fairhead code.  The numerical results are
3155     *     essentially unaffected by the changes, the differences with
3156     *     respect to the Fairhead &amp; Bretagnon original being at the 1e-20 s
3157     *     level.
3158     *
3159     *     The topocentric part of the model is from Moyer (1981) and
3160     *     Murray (1983), with fundamental arguments adapted from
3161     *     Simon et al. 1994.  It is an approximation to the expression
3162     *     ( v / c ) . ( r / c ), where v is the barycentric velocity of
3163     *     the Earth, r is the geocentric position of the observer and
3164     *     c is the speed of light.
3165     *
3166     *     By supplying zeroes for u and v, the topocentric part of the
3167     *     model can be nullified, and the function will return the Fairhead
3168     *     &amp; Bretagnon result alone.
3169     *
3170     * <li> During the interval 1950-2050, the absolute accuracy is better
3171     *     than +/- 3 nanoseconds relative to time ephemerides obtained by
3172     *     direct numerical integrations based on the JPL DE405 solar system
3173     *     ephemeris.
3174     *
3175     * <li> It must be stressed that the present function is merely a model,
3176     *     and that numerical integration of solar-system ephemerides is the
3177     *     definitive method for predicting the relationship between TCG and
3178     *     TCB and hence between TT and TDB.
3179     *</ol>
3180     *<p>References:
3181     *
3182     *     <p>Fairhead, L., &amp; Bretagnon, P., Astron.Astrophys., 229, 240-247
3183     *     (1990).
3184     *
3185     *     <p>IAU 2006 Resolution 3.
3186     *
3187     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
3188     *     IERS Technical Note No. 32, BKG (2004)
3189     *
3190     *     <p>Moyer, T.D., Cel.Mech., 23, 33 (1981).
3191     *
3192     *     <p>Murray, C.A., Vectorial Astrometry, Adam Hilger (1983).
3193     *
3194     *     <p>Seidelmann, P.K. et al., Explanatory Supplement to the
3195     *     Astronomical Almanac, Chapter 2, University Science Books (1992).
3196     *
3197     *     <p>Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
3198     *     Francou, G. &amp; Laskar, J., Astron.Astrophys., 282, 663-683 (1994).
3199     *
3200     *@version 2009 December 17
3201     *
3202     *  @since Release 20101201
3203     *
3204     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
3205     */
3206     public static  double jauDtdb(double date1, double date2,
3207                    double ut, double elong, double u, double v)
3208     {
3209        double t, tsol, w, elsun, emsun, d, elj, els, wt, w0, w1, w2, w3, w4,
3210               wf, wj;
3211        int j;
3212 
3213     /*
3214     * =====================
3215     * Fairhead et al. model
3216     * =====================
3217     *
3218     * 787 sets of three coefficients.
3219     *
3220     * Each set is
3221     *    amplitude (microseconds)
3222     *      frequency (radians per Julian millennium since J2000.0)
3223     *      phase (radians)
3224     *
3225     * Sets   1-474 are the T**0 terms
3226     *  "   475-679  "   "  T**1
3227     *  "   680-764  "   "  T**2
3228     *  "   765-784  "   "  T**3
3229     *  "   785-787  "   "  T**4
3230     */
3231 
3232        final double fairhd[][] = {
3233        /* 1, 10 */
3234           { 1656.674564e-6,     6283.075849991,  6.240054195 },
3235           {   22.417471e-6,     5753.384884897,  4.296977442 },
3236           {   13.839792e-6,    12566.151699983,  6.196904410 },
3237           {    4.770086e-6,      529.690965095,  0.444401603 },
3238           {    4.676740e-6,     6069.776754553,  4.021195093 },
3239           {    2.256707e-6,      213.299095438,  5.543113262 },
3240           {    1.694205e-6,      -3.523118349,   5.025132748 },
3241           {    1.554905e-6,    77713.771467920,  5.198467090 },
3242           {    1.276839e-6,     7860.419392439,  5.988822341 },
3243           {    1.193379e-6,     5223.693919802,  3.649823730 },
3244        /* 11, 20 */
3245           {    1.115322e-6,     3930.209696220,  1.422745069 },
3246           {    0.794185e-6,    11506.769769794,  2.322313077 },
3247           {    0.447061e-6,       26.298319800,  3.615796498 },
3248           {    0.435206e-6,     -398.149003408,  4.349338347 },
3249           {    0.600309e-6,     1577.343542448,  2.678271909 },
3250           {    0.496817e-6,     6208.294251424,  5.696701824 },
3251           {    0.486306e-6,     5884.926846583,  0.520007179 },
3252           {    0.432392e-6,       74.781598567,  2.435898309 },
3253           {    0.468597e-6,     6244.942814354,  5.866398759 },
3254           {    0.375510e-6,     5507.553238667,  4.103476804 },
3255        /* 21, 30 */
3256           {    0.243085e-6,     -775.522611324,  3.651837925 },
3257           {    0.173435e-6,    18849.227549974,  6.153743485 },
3258           {    0.230685e-6,     5856.477659115,  4.773852582 },
3259           {    0.203747e-6,    12036.460734888,  4.333987818 },
3260           {    0.143935e-6,     -796.298006816,  5.957517795 },
3261           {    0.159080e-6,    10977.078804699,  1.890075226 },
3262           {    0.119979e-6,       38.133035638,  4.551585768 },
3263           {    0.118971e-6,     5486.777843175,  1.914547226 },
3264           {    0.116120e-6,     1059.381930189,  0.873504123 },
3265           {    0.137927e-6,    11790.629088659,  1.135934669 },
3266        /* 31, 40 */
3267           {    0.098358e-6,     2544.314419883,  0.092793886 },
3268           {    0.101868e-6,    -5573.142801634,  5.984503847 },
3269           {    0.080164e-6,      206.185548437,  2.095377709 },
3270           {    0.079645e-6,     4694.002954708,  2.949233637 },
3271           {    0.062617e-6,       20.775395492,  2.654394814 },
3272           {    0.075019e-6,     2942.463423292,  4.980931759 },
3273           {    0.064397e-6,     5746.271337896,  1.280308748 },
3274           {    0.063814e-6,     5760.498431898,  4.167901731 },
3275           {    0.048042e-6,     2146.165416475,  1.495846011 },
3276           {    0.048373e-6,      155.420399434,  2.251573730 },
3277        /* 41, 50 */
3278           {    0.058844e-6,      426.598190876,  4.839650148 },
3279           {    0.046551e-6,       -0.980321068,  0.921573539 },
3280           {    0.054139e-6,    17260.154654690,  3.411091093 },
3281           {    0.042411e-6,     6275.962302991,  2.869567043 },
3282           {    0.040184e-6,       -7.113547001,  3.565975565 },
3283           {    0.036564e-6,     5088.628839767,  3.324679049 },
3284           {    0.040759e-6,    12352.852604545,  3.981496998 },
3285           {    0.036507e-6,      801.820931124,  6.248866009 },
3286           {    0.036955e-6,     3154.687084896,  5.071801441 },
3287           {    0.042732e-6,      632.783739313,  5.720622217 },
3288        /* 51, 60 */
3289           {    0.042560e-6,   161000.685737473,  1.270837679 },
3290           {    0.040480e-6,    15720.838784878,  2.546610123 },
3291           {    0.028244e-6,    -6286.598968340,  5.069663519 },
3292           {    0.033477e-6,     6062.663207553,  4.144987272 },
3293           {    0.034867e-6,      522.577418094,  5.210064075 },
3294           {    0.032438e-6,     6076.890301554,  0.749317412 },
3295           {    0.030215e-6,     7084.896781115,  3.389610345 },
3296           {    0.029247e-6,   -71430.695617928,  4.183178762 },
3297           {    0.033529e-6,     9437.762934887,  2.404714239 },
3298           {    0.032423e-6,     8827.390269875,  5.541473556 },
3299        /* 61, 70 */
3300           {    0.027567e-6,     6279.552731642,  5.040846034 },
3301           {    0.029862e-6,    12139.553509107,  1.770181024 },
3302           {    0.022509e-6,    10447.387839604,  1.460726241 },
3303           {    0.020937e-6,     8429.241266467,  0.652303414 },
3304           {    0.020322e-6,      419.484643875,  3.735430632 },
3305           {    0.024816e-6,    -1194.447010225,  1.087136918 },
3306           {    0.025196e-6,     1748.016413067,  2.901883301 },
3307           {    0.021691e-6,    14143.495242431,  5.952658009 },
3308           {    0.017673e-6,     6812.766815086,  3.186129845 },
3309           {    0.022567e-6,     6133.512652857,  3.307984806 },
3310        /* 71, 80 */
3311           {    0.016155e-6,    10213.285546211,  1.331103168 },
3312           {    0.014751e-6,     1349.867409659,  4.308933301 },
3313           {    0.015949e-6,     -220.412642439,  4.005298270 },
3314           {    0.015974e-6,    -2352.866153772,  6.145309371 },
3315           {    0.014223e-6,    17789.845619785,  2.104551349 },
3316           {    0.017806e-6,       73.297125859,  3.475975097 },
3317           {    0.013671e-6,     -536.804512095,  5.971672571 },
3318           {    0.011942e-6,     8031.092263058,  2.053414715 },
3319           {    0.014318e-6,    16730.463689596,  3.016058075 },
3320           {    0.012462e-6,      103.092774219,  1.737438797 },
3321        /* 81, 90 */
3322           {    0.010962e-6,        3.590428652,  2.196567739 },
3323           {    0.015078e-6,    19651.048481098,  3.969480770 },
3324           {    0.010396e-6,      951.718406251,  5.717799605 },
3325           {    0.011707e-6,    -4705.732307544,  2.654125618 },
3326           {    0.010453e-6,     5863.591206116,  1.913704550 },
3327           {    0.012420e-6,     4690.479836359,  4.734090399 },
3328           {    0.011847e-6,     5643.178563677,  5.489005403 },
3329           {    0.008610e-6,     3340.612426700,  3.661698944 },
3330           {    0.011622e-6,     5120.601145584,  4.863931876 },
3331           {    0.010825e-6,      553.569402842,  0.842715011 },
3332        /* 91, 100 */
3333           {    0.008666e-6,     -135.065080035,  3.293406547 },
3334           {    0.009963e-6,      149.563197135,  4.870690598 },
3335           {    0.009858e-6,     6309.374169791,  1.061816410 },
3336           {    0.007959e-6,      316.391869657,  2.465042647 },
3337           {    0.010099e-6,      283.859318865,  1.942176992 },
3338           {    0.007147e-6,     -242.728603974,  3.661486981 },
3339           {    0.007505e-6,     5230.807466803,  4.920937029 },
3340           {    0.008323e-6,    11769.853693166,  1.229392026 },
3341           {    0.007490e-6,    -6256.777530192,  3.658444681 },
3342           {    0.009370e-6,   149854.400134205,  0.673880395 },
3343        /* 101, 110 */
3344           {    0.007117e-6,       38.027672636,  5.294249518 },
3345           {    0.007857e-6,    12168.002696575,  0.525733528 },
3346           {    0.007019e-6,     6206.809778716,  0.837688810 },
3347           {    0.006056e-6,      955.599741609,  4.194535082 },
3348           {    0.008107e-6,    13367.972631107,  3.793235253 },
3349           {    0.006731e-6,     5650.292110678,  5.639906583 },
3350           {    0.007332e-6,       36.648562930,  0.114858677 },
3351           {    0.006366e-6,     4164.311989613,  2.262081818 },
3352           {    0.006858e-6,     5216.580372801,  0.642063318 },
3353           {    0.006919e-6,     6681.224853400,  6.018501522 },
3354        /* 111, 120 */
3355           {    0.006826e-6,     7632.943259650,  3.458654112 },
3356           {    0.005308e-6,    -1592.596013633,  2.500382359 },
3357           {    0.005096e-6,    11371.704689758,  2.547107806 },
3358           {    0.004841e-6,     5333.900241022,  0.437078094 },
3359           {    0.005582e-6,     5966.683980335,  2.246174308 },
3360           {    0.006304e-6,    11926.254413669,  2.512929171 },
3361           {    0.006603e-6,    23581.258177318,  5.393136889 },
3362           {    0.005123e-6,       -1.484472708,  2.999641028 },
3363           {    0.004648e-6,     1589.072895284,  1.275847090 },
3364           {    0.005119e-6,     6438.496249426,  1.486539246 },
3365        /* 121, 130 */
3366           {    0.004521e-6,     4292.330832950,  6.140635794 },
3367           {    0.005680e-6,    23013.539539587,  4.557814849 },
3368           {    0.005488e-6,       -3.455808046,  0.090675389 },
3369           {    0.004193e-6,     7234.794256242,  4.869091389 },
3370           {    0.003742e-6,     7238.675591600,  4.691976180 },
3371           {    0.004148e-6,     -110.206321219,  3.016173439 },
3372           {    0.004553e-6,    11499.656222793,  5.554998314 },
3373           {    0.004892e-6,     5436.993015240,  1.475415597 },
3374           {    0.004044e-6,     4732.030627343,  1.398784824 },
3375           {    0.004164e-6,    12491.370101415,  5.650931916 },
3376        /* 131, 140 */
3377           {    0.004349e-6,    11513.883316794,  2.181745369 },
3378           {    0.003919e-6,    12528.018664345,  5.823319737 },
3379           {    0.003129e-6,     6836.645252834,  0.003844094 },
3380           {    0.004080e-6,    -7058.598461315,  3.690360123 },
3381           {    0.003270e-6,       76.266071276,  1.517189902 },
3382           {    0.002954e-6,     6283.143160294,  4.447203799 },
3383           {    0.002872e-6,       28.449187468,  1.158692983 },
3384           {    0.002881e-6,      735.876513532,  0.349250250 },
3385           {    0.003279e-6,     5849.364112115,  4.893384368 },
3386           {    0.003625e-6,     6209.778724132,  1.473760578 },
3387        /* 141, 150 */
3388           {    0.003074e-6,      949.175608970,  5.185878737 },
3389           {    0.002775e-6,     9917.696874510,  1.030026325 },
3390           {    0.002646e-6,    10973.555686350,  3.918259169 },
3391           {    0.002575e-6,    25132.303399966,  6.109659023 },
3392           {    0.003500e-6,      263.083923373,  1.892100742 },
3393           {    0.002740e-6,    18319.536584880,  4.320519510 },
3394           {    0.002464e-6,      202.253395174,  4.698203059 },
3395           {    0.002409e-6,        2.542797281,  5.325009315 },
3396           {    0.003354e-6,   -90955.551694697,  1.942656623 },
3397           {    0.002296e-6,     6496.374945429,  5.061810696 },
3398        /* 151, 160 */
3399           {    0.003002e-6,     6172.869528772,  2.797822767 },
3400           {    0.003202e-6,    27511.467873537,  0.531673101 },
3401           {    0.002954e-6,    -6283.008539689,  4.533471191 },
3402           {    0.002353e-6,      639.897286314,  3.734548088 },
3403           {    0.002401e-6,    16200.772724501,  2.605547070 },
3404           {    0.003053e-6,   233141.314403759,  3.029030662 },
3405           {    0.003024e-6,    83286.914269554,  2.355556099 },
3406           {    0.002863e-6,    17298.182327326,  5.240963796 },
3407           {    0.002103e-6,    -7079.373856808,  5.756641637 },
3408           {    0.002303e-6,    83996.847317911,  2.013686814 },
3409        /* 161, 170 */
3410           {    0.002303e-6,    18073.704938650,  1.089100410 },
3411           {    0.002381e-6,       63.735898303,  0.759188178 },
3412           {    0.002493e-6,     6386.168624210,  0.645026535 },
3413           {    0.002366e-6,        3.932153263,  6.215885448 },
3414           {    0.002169e-6,    11015.106477335,  4.845297676 },
3415           {    0.002397e-6,     6243.458341645,  3.809290043 },
3416           {    0.002183e-6,     1162.474704408,  6.179611691 },
3417           {    0.002353e-6,     6246.427287062,  4.781719760 },
3418           {    0.002199e-6,     -245.831646229,  5.956152284 },
3419           {    0.001729e-6,     3894.181829542,  1.264976635 },
3420        /* 171, 180 */
3421           {    0.001896e-6,    -3128.388765096,  4.914231596 },
3422           {    0.002085e-6,       35.164090221,  1.405158503 },
3423           {    0.002024e-6,    14712.317116458,  2.752035928 },
3424           {    0.001737e-6,     6290.189396992,  5.280820144 },
3425           {    0.002229e-6,      491.557929457,  1.571007057 },
3426           {    0.001602e-6,    14314.168113050,  4.203664806 },
3427           {    0.002186e-6,      454.909366527,  1.402101526 },
3428           {    0.001897e-6,    22483.848574493,  4.167932508 },
3429           {    0.001825e-6,    -3738.761430108,  0.545828785 },
3430           {    0.001894e-6,     1052.268383188,  5.817167450 },
3431        /* 181, 190 */
3432           {    0.001421e-6,       20.355319399,  2.419886601 },
3433           {    0.001408e-6,    10984.192351700,  2.732084787 },
3434           {    0.001847e-6,    10873.986030480,  2.903477885 },
3435           {    0.001391e-6,    -8635.942003763,  0.593891500 },
3436           {    0.001388e-6,       -7.046236698,  1.166145902 },
3437           {    0.001810e-6,   -88860.057071188,  0.487355242 },
3438           {    0.001288e-6,    -1990.745017041,  3.913022880 },
3439           {    0.001297e-6,    23543.230504682,  3.063805171 },
3440           {    0.001335e-6,     -266.607041722,  3.995764039 },
3441           {    0.001376e-6,    10969.965257698,  5.152914309 },
3442        /* 191, 200 */
3443           {    0.001745e-6,   244287.600007027,  3.626395673 },
3444           {    0.001649e-6,    31441.677569757,  1.952049260 },
3445           {    0.001416e-6,     9225.539273283,  4.996408389 },
3446           {    0.001238e-6,     4804.209275927,  5.503379738 },
3447           {    0.001472e-6,     4590.910180489,  4.164913291 },
3448           {    0.001169e-6,     6040.347246017,  5.841719038 },
3449           {    0.001039e-6,     5540.085789459,  2.769753519 },
3450           {    0.001004e-6,     -170.672870619,  0.755008103 },
3451           {    0.001284e-6,    10575.406682942,  5.306538209 },
3452           {    0.001278e-6,       71.812653151,  4.713486491 },
3453        /* 201, 210 */
3454           {    0.001321e-6,    18209.330263660,  2.624866359 },
3455           {    0.001297e-6,    21228.392023546,  0.382603541 },
3456           {    0.000954e-6,     6282.095528923,  0.882213514 },
3457           {    0.001145e-6,     6058.731054289,  1.169483931 },
3458           {    0.000979e-6,     5547.199336460,  5.448375984 },
3459           {    0.000987e-6,    -6262.300454499,  2.656486959 },
3460           {    0.001070e-6,  -154717.609887482,  1.827624012 },
3461           {    0.000991e-6,     4701.116501708,  4.387001801 },
3462           {    0.001155e-6,      -14.227094002,  3.042700750 },
3463           {    0.001176e-6,      277.034993741,  3.335519004 },
3464        /* 211, 220 */
3465           {    0.000890e-6,    13916.019109642,  5.601498297 },
3466           {    0.000884e-6,    -1551.045222648,  1.088831705 },
3467           {    0.000876e-6,     5017.508371365,  3.969902609 },
3468           {    0.000806e-6,    15110.466119866,  5.142876744 },
3469           {    0.000773e-6,    -4136.910433516,  0.022067765 },
3470           {    0.001077e-6,      175.166059800,  1.844913056 },
3471           {    0.000954e-6,    -6284.056171060,  0.968480906 },
3472           {    0.000737e-6,     5326.786694021,  4.923831588 },
3473           {    0.000845e-6,     -433.711737877,  4.749245231 },
3474           {    0.000819e-6,     8662.240323563,  5.991247817 },
3475        /* 221, 230 */
3476           {    0.000852e-6,      199.072001436,  2.189604979 },
3477           {    0.000723e-6,    17256.631536341,  6.068719637 },
3478           {    0.000940e-6,     6037.244203762,  6.197428148 },
3479           {    0.000885e-6,    11712.955318231,  3.280414875 },
3480           {    0.000706e-6,    12559.038152982,  2.824848947 },
3481           {    0.000732e-6,     2379.164473572,  2.501813417 },
3482           {    0.000764e-6,    -6127.655450557,  2.236346329 },
3483           {    0.000908e-6,      131.541961686,  2.521257490 },
3484           {    0.000907e-6,    35371.887265976,  3.370195967 },
3485           {    0.000673e-6,     1066.495477190,  3.876512374 },
3486        /* 231, 240 */
3487           {    0.000814e-6,    17654.780539750,  4.627122566 },
3488           {    0.000630e-6,       36.027866677,  0.156368499 },
3489           {    0.000798e-6,      515.463871093,  5.151962502 },
3490           {    0.000798e-6,      148.078724426,  5.909225055 },
3491           {    0.000806e-6,      309.278322656,  6.054064447 },
3492           {    0.000607e-6,      -39.617508346,  2.839021623 },
3493           {    0.000601e-6,      412.371096874,  3.984225404 },
3494           {    0.000646e-6,    11403.676995575,  3.852959484 },
3495           {    0.000704e-6,    13521.751441591,  2.300991267 },
3496           {    0.000603e-6,   -65147.619767937,  4.140083146 },
3497        /* 241, 250 */
3498           {    0.000609e-6,    10177.257679534,  0.437122327 },
3499           {    0.000631e-6,     5767.611978898,  4.026532329 },
3500           {    0.000576e-6,    11087.285125918,  4.760293101 },
3501           {    0.000674e-6,    14945.316173554,  6.270510511 },
3502           {    0.000726e-6,     5429.879468239,  6.039606892 },
3503           {    0.000710e-6,    28766.924424484,  5.672617711 },
3504           {    0.000647e-6,    11856.218651625,  3.397132627 },
3505           {    0.000678e-6,    -5481.254918868,  6.249666675 },
3506           {    0.000618e-6,    22003.914634870,  2.466427018 },
3507           {    0.000738e-6,     6134.997125565,  2.242668890 },
3508        /* 251, 260 */
3509           {    0.000660e-6,      625.670192312,  5.864091907 },
3510           {    0.000694e-6,     3496.032826134,  2.668309141 },
3511           {    0.000531e-6,     6489.261398429,  1.681888780 },
3512           {    0.000611e-6,  -143571.324284214,  2.424978312 },
3513           {    0.000575e-6,    12043.574281889,  4.216492400 },
3514           {    0.000553e-6,    12416.588502848,  4.772158039 },
3515           {    0.000689e-6,     4686.889407707,  6.224271088 },
3516           {    0.000495e-6,     7342.457780181,  3.817285811 },
3517           {    0.000567e-6,     3634.621024518,  1.649264690 },
3518           {    0.000515e-6,    18635.928454536,  3.945345892 },
3519        /* 261, 270 */
3520           {    0.000486e-6,     -323.505416657,  4.061673868 },
3521           {    0.000662e-6,    25158.601719765,  1.794058369 },
3522           {    0.000509e-6,      846.082834751,  3.053874588 },
3523           {    0.000472e-6,   -12569.674818332,  5.112133338 },
3524           {    0.000461e-6,     6179.983075773,  0.513669325 },
3525           {    0.000641e-6,    83467.156352816,  3.210727723 },
3526           {    0.000520e-6,    10344.295065386,  2.445597761 },
3527           {    0.000493e-6,    18422.629359098,  1.676939306 },
3528           {    0.000478e-6,     1265.567478626,  5.487314569 },
3529           {    0.000472e-6,      -18.159247265,  1.999707589 },
3530        /* 271, 280 */
3531           {    0.000559e-6,    11190.377900137,  5.783236356 },
3532           {    0.000494e-6,     9623.688276691,  3.022645053 },
3533           {    0.000463e-6,     5739.157790895,  1.411223013 },
3534           {    0.000432e-6,    16858.482532933,  1.179256434 },
3535           {    0.000574e-6,    72140.628666286,  1.758191830 },
3536           {    0.000484e-6,    17267.268201691,  3.290589143 },
3537           {    0.000550e-6,     4907.302050146,  0.864024298 },
3538           {    0.000399e-6,       14.977853527,  2.094441910 },
3539           {    0.000491e-6,      224.344795702,  0.878372791 },
3540           {    0.000432e-6,    20426.571092422,  6.003829241 },
3541        /* 281, 290 */
3542           {    0.000481e-6,     5749.452731634,  4.309591964 },
3543           {    0.000480e-6,     5757.317038160,  1.142348571 },
3544           {    0.000485e-6,     6702.560493867,  0.210580917 },
3545           {    0.000426e-6,     6055.549660552,  4.274476529 },
3546           {    0.000480e-6,     5959.570433334,  5.031351030 },
3547           {    0.000466e-6,    12562.628581634,  4.959581597 },
3548           {    0.000520e-6,    39302.096962196,  4.788002889 },
3549           {    0.000458e-6,    12132.439962106,  1.880103788 },
3550           {    0.000470e-6,    12029.347187887,  1.405611197 },
3551           {    0.000416e-6,    -7477.522860216,  1.082356330 },
3552        /* 291, 300 */
3553           {    0.000449e-6,    11609.862544012,  4.179989585 },
3554           {    0.000465e-6,    17253.041107690,  0.353496295 },
3555           {    0.000362e-6,    -4535.059436924,  1.583849576 },
3556           {    0.000383e-6,    21954.157609398,  3.747376371 },
3557           {    0.000389e-6,       17.252277143,  1.395753179 },
3558           {    0.000331e-6,    18052.929543158,  0.566790582 },
3559           {    0.000430e-6,    13517.870106233,  0.685827538 },
3560           {    0.000368e-6,    -5756.908003246,  0.731374317 },
3561           {    0.000330e-6,    10557.594160824,  3.710043680 },
3562           {    0.000332e-6,    20199.094959633,  1.652901407 },
3563        /* 301, 310 */
3564           {    0.000384e-6,    11933.367960670,  5.827781531 },
3565           {    0.000387e-6,    10454.501386605,  2.541182564 },
3566           {    0.000325e-6,    15671.081759407,  2.178850542 },
3567           {    0.000318e-6,      138.517496871,  2.253253037 },
3568           {    0.000305e-6,     9388.005909415,  0.578340206 },
3569           {    0.000352e-6,     5749.861766548,  3.000297967 },
3570           {    0.000311e-6,     6915.859589305,  1.693574249 },
3571           {    0.000297e-6,    24072.921469776,  1.997249392 },
3572           {    0.000363e-6,     -640.877607382,  5.071820966 },
3573           {    0.000323e-6,    12592.450019783,  1.072262823 },
3574        /* 311, 320 */
3575           {    0.000341e-6,    12146.667056108,  4.700657997 },
3576           {    0.000290e-6,     9779.108676125,  1.812320441 },
3577           {    0.000342e-6,     6132.028180148,  4.322238614 },
3578           {    0.000329e-6,     6268.848755990,  3.033827743 },
3579           {    0.000374e-6,    17996.031168222,  3.388716544 },
3580           {    0.000285e-6,     -533.214083444,  4.687313233 },
3581           {    0.000338e-6,     6065.844601290,  0.877776108 },
3582           {    0.000276e-6,       24.298513841,  0.770299429 },
3583           {    0.000336e-6,    -2388.894020449,  5.353796034 },
3584           {    0.000290e-6,     3097.883822726,  4.075291557 },
3585        /* 321, 330 */
3586           {    0.000318e-6,      709.933048357,  5.941207518 },
3587           {    0.000271e-6,    13095.842665077,  3.208912203 },
3588           {    0.000331e-6,     6073.708907816,  4.007881169 },
3589           {    0.000292e-6,      742.990060533,  2.714333592 },
3590           {    0.000362e-6,    29088.811415985,  3.215977013 },
3591           {    0.000280e-6,    12359.966151546,  0.710872502 },
3592           {    0.000267e-6,    10440.274292604,  4.730108488 },
3593           {    0.000262e-6,      838.969287750,  1.327720272 },
3594           {    0.000250e-6,    16496.361396202,  0.898769761 },
3595           {    0.000325e-6,    20597.243963041,  0.180044365 },
3596        /* 331, 340 */
3597           {    0.000268e-6,     6148.010769956,  5.152666276 },
3598           {    0.000284e-6,     5636.065016677,  5.655385808 },
3599           {    0.000301e-6,     6080.822454817,  2.135396205 },
3600           {    0.000294e-6,     -377.373607916,  3.708784168 },
3601           {    0.000236e-6,     2118.763860378,  1.733578756 },
3602           {    0.000234e-6,     5867.523359379,  5.575209112 },
3603           {    0.000268e-6,  -226858.238553767,  0.069432392 },
3604           {    0.000265e-6,   167283.761587465,  4.369302826 },
3605           {    0.000280e-6,    28237.233459389,  5.304829118 },
3606           {    0.000292e-6,    12345.739057544,  4.096094132 },
3607        /* 341, 350 */
3608           {    0.000223e-6,    19800.945956225,  3.069327406 },
3609           {    0.000301e-6,    43232.306658416,  6.205311188 },
3610           {    0.000264e-6,    18875.525869774,  1.417263408 },
3611           {    0.000304e-6,    -1823.175188677,  3.409035232 },
3612           {    0.000301e-6,      109.945688789,  0.510922054 },
3613           {    0.000260e-6,      813.550283960,  2.389438934 },
3614           {    0.000299e-6,   316428.228673312,  5.384595078 },
3615           {    0.000211e-6,     5756.566278634,  3.789392838 },
3616           {    0.000209e-6,     5750.203491159,  1.661943545 },
3617           {    0.000240e-6,    12489.885628707,  5.684549045 },
3618        /* 351, 360 */
3619           {    0.000216e-6,     6303.851245484,  3.862942261 },
3620           {    0.000203e-6,     1581.959348283,  5.549853589 },
3621           {    0.000200e-6,     5642.198242609,  1.016115785 },
3622           {    0.000197e-6,      -70.849445304,  4.690702525 },
3623           {    0.000227e-6,     6287.008003254,  2.911891613 },
3624           {    0.000197e-6,      533.623118358,  1.048982898 },
3625           {    0.000205e-6,    -6279.485421340,  1.829362730 },
3626           {    0.000209e-6,   -10988.808157535,  2.636140084 },
3627           {    0.000208e-6,     -227.526189440,  4.127883842 },
3628           {    0.000191e-6,      415.552490612,  4.401165650 },
3629        /* 361, 370 */
3630           {    0.000190e-6,    29296.615389579,  4.175658539 },
3631           {    0.000264e-6,    66567.485864652,  4.601102551 },
3632           {    0.000256e-6,    -3646.350377354,  0.506364778 },
3633           {    0.000188e-6,    13119.721102825,  2.032195842 },
3634           {    0.000185e-6,     -209.366942175,  4.694756586 },
3635           {    0.000198e-6,    25934.124331089,  3.832703118 },
3636           {    0.000195e-6,     4061.219215394,  3.308463427 },
3637           {    0.000234e-6,     5113.487598583,  1.716090661 },
3638           {    0.000188e-6,     1478.866574064,  5.686865780 },
3639           {    0.000222e-6,    11823.161639450,  1.942386641 },
3640        /* 371, 380 */
3641           {    0.000181e-6,    10770.893256262,  1.999482059 },
3642           {    0.000171e-6,     6546.159773364,  1.182807992 },
3643           {    0.000206e-6,       70.328180442,  5.934076062 },
3644           {    0.000169e-6,    20995.392966449,  2.169080622 },
3645           {    0.000191e-6,    10660.686935042,  5.405515999 },
3646           {    0.000228e-6,    33019.021112205,  4.656985514 },
3647           {    0.000184e-6,    -4933.208440333,  3.327476868 },
3648           {    0.000220e-6,     -135.625325010,  1.765430262 },
3649           {    0.000166e-6,    23141.558382925,  3.454132746 },
3650           {    0.000191e-6,     6144.558353121,  5.020393445 },
3651        /* 381, 390 */
3652           {    0.000180e-6,     6084.003848555,  0.602182191 },
3653           {    0.000163e-6,    17782.732072784,  4.960593133 },
3654           {    0.000225e-6,    16460.333529525,  2.596451817 },
3655           {    0.000222e-6,     5905.702242076,  3.731990323 },
3656           {    0.000204e-6,      227.476132789,  5.636192701 },
3657           {    0.000159e-6,    16737.577236597,  3.600691544 },
3658           {    0.000200e-6,     6805.653268085,  0.868220961 },
3659           {    0.000187e-6,    11919.140866668,  2.629456641 },
3660           {    0.000161e-6,      127.471796607,  2.862574720 },
3661           {    0.000205e-6,     6286.666278643,  1.742882331 },
3662        /* 391, 400 */
3663           {    0.000189e-6,      153.778810485,  4.812372643 },
3664           {    0.000168e-6,    16723.350142595,  0.027860588 },
3665           {    0.000149e-6,    11720.068865232,  0.659721876 },
3666           {    0.000189e-6,     5237.921013804,  5.245313000 },
3667           {    0.000143e-6,     6709.674040867,  4.317625647 },
3668           {    0.000146e-6,     4487.817406270,  4.815297007 },
3669           {    0.000144e-6,     -664.756045130,  5.381366880 },
3670           {    0.000175e-6,     5127.714692584,  4.728443327 },
3671           {    0.000162e-6,     6254.626662524,  1.435132069 },
3672           {    0.000187e-6,    47162.516354635,  1.354371923 },
3673        /* 401, 410 */
3674           {    0.000146e-6,    11080.171578918,  3.369695406 },
3675           {    0.000180e-6,     -348.924420448,  2.490902145 },
3676           {    0.000148e-6,      151.047669843,  3.799109588 },
3677           {    0.000157e-6,     6197.248551160,  1.284375887 },
3678           {    0.000167e-6,      146.594251718,  0.759969109 },
3679           {    0.000133e-6,    -5331.357443741,  5.409701889 },
3680           {    0.000154e-6,       95.979227218,  3.366890614 },
3681           {    0.000148e-6,    -6418.140930027,  3.384104996 },
3682           {    0.000128e-6,    -6525.804453965,  3.803419985 },
3683           {    0.000130e-6,    11293.470674356,  0.939039445 },
3684        /* 411, 420 */
3685           {    0.000152e-6,    -5729.506447149,  0.734117523 },
3686           {    0.000138e-6,      210.117701700,  2.564216078 },
3687           {    0.000123e-6,     6066.595360816,  4.517099537 },
3688           {    0.000140e-6,    18451.078546566,  0.642049130 },
3689           {    0.000126e-6,    11300.584221356,  3.485280663 },
3690           {    0.000119e-6,    10027.903195729,  3.217431161 },
3691           {    0.000151e-6,     4274.518310832,  4.404359108 },
3692           {    0.000117e-6,     6072.958148291,  0.366324650 },
3693           {    0.000165e-6,    -7668.637425143,  4.298212528 },
3694           {    0.000117e-6,    -6245.048177356,  5.379518958 },
3695        /* 421, 430 */
3696           {    0.000130e-6,    -5888.449964932,  4.527681115 },
3697           {    0.000121e-6,     -543.918059096,  6.109429504 },
3698           {    0.000162e-6,     9683.594581116,  5.720092446 },
3699           {    0.000141e-6,     6219.339951688,  0.679068671 },
3700           {    0.000118e-6,    22743.409379516,  4.881123092 },
3701           {    0.000129e-6,     1692.165669502,  0.351407289 },
3702           {    0.000126e-6,     5657.405657679,  5.146592349 },
3703           {    0.000114e-6,      728.762966531,  0.520791814 },
3704           {    0.000120e-6,       52.596639600,  0.948516300 },
3705           {    0.000115e-6,       65.220371012,  3.504914846 },
3706        /* 431, 440 */
3707           {    0.000126e-6,     5881.403728234,  5.577502482 },
3708           {    0.000158e-6,   163096.180360983,  2.957128968 },
3709           {    0.000134e-6,    12341.806904281,  2.598576764 },
3710           {    0.000151e-6,    16627.370915377,  3.985702050 },
3711           {    0.000109e-6,     1368.660252845,  0.014730471 },
3712           {    0.000131e-6,     6211.263196841,  0.085077024 },
3713           {    0.000146e-6,     5792.741760812,  0.708426604 },
3714           {    0.000146e-6,      -77.750543984,  3.121576600 },
3715           {    0.000107e-6,     5341.013788022,  0.288231904 },
3716           {    0.000138e-6,     6281.591377283,  2.797450317 },
3717        /* 441, 450 */
3718           {    0.000113e-6,    -6277.552925684,  2.788904128 },
3719           {    0.000115e-6,     -525.758811831,  5.895222200 },
3720           {    0.000138e-6,     6016.468808270,  6.096188999 },
3721           {    0.000139e-6,    23539.707386333,  2.028195445 },
3722           {    0.000146e-6,    -4176.041342449,  4.660008502 },
3723           {    0.000107e-6,    16062.184526117,  4.066520001 },
3724           {    0.000142e-6,    83783.548222473,  2.936315115 },
3725           {    0.000128e-6,     9380.959672717,  3.223844306 },
3726           {    0.000135e-6,     6205.325306007,  1.638054048 },
3727           {    0.000101e-6,     2699.734819318,  5.481603249 },
3728        /* 451, 460 */
3729           {    0.000104e-6,     -568.821874027,  2.205734493 },
3730           {    0.000103e-6,     6321.103522627,  2.440421099 },
3731           {    0.000119e-6,     6321.208885629,  2.547496264 },
3732           {    0.000138e-6,     1975.492545856,  2.314608466 },
3733           {    0.000121e-6,      137.033024162,  4.539108237 },
3734           {    0.000123e-6,    19402.796952817,  4.538074405 },
3735           {    0.000119e-6,    22805.735565994,  2.869040566 },
3736           {    0.000133e-6,    64471.991241142,  6.056405489 },
3737           {    0.000129e-6,      -85.827298831,  2.540635083 },
3738           {    0.000131e-6,    13613.804277336,  4.005732868 },
3739        /* 461, 470 */
3740           {    0.000104e-6,     9814.604100291,  1.959967212 },
3741           {    0.000112e-6,    16097.679950283,  3.589026260 },
3742           {    0.000123e-6,     2107.034507542,  1.728627253 },
3743           {    0.000121e-6,    36949.230808424,  6.072332087 },
3744           {    0.000108e-6,   -12539.853380183,  3.716133846 },
3745           {    0.000113e-6,    -7875.671863624,  2.725771122 },
3746           {    0.000109e-6,     4171.425536614,  4.033338079 },
3747           {    0.000101e-6,     6247.911759770,  3.441347021 },
3748           {    0.000113e-6,     7330.728427345,  0.656372122 },
3749           {    0.000113e-6,    51092.726050855,  2.791483066 },
3750        /* 471, 480 */
3751           {    0.000106e-6,     5621.842923210,  1.815323326 },
3752           {    0.000101e-6,      111.430161497,  5.711033677 },
3753           {    0.000103e-6,      909.818733055,  2.812745443 },
3754           {    0.000101e-6,     1790.642637886,  1.965746028 },
3755 
3756        /* T */
3757           {  102.156724e-6,     6283.075849991,  4.249032005 },
3758           {    1.706807e-6,    12566.151699983,  4.205904248 },
3759           {    0.269668e-6,      213.299095438,  3.400290479 },
3760           {    0.265919e-6,      529.690965095,  5.836047367 },
3761           {    0.210568e-6,       -3.523118349,  6.262738348 },
3762           {    0.077996e-6,     5223.693919802,  4.670344204 },
3763        /* 481, 490 */
3764           {    0.054764e-6,     1577.343542448,  4.534800170 },
3765           {    0.059146e-6,       26.298319800,  1.083044735 },
3766           {    0.034420e-6,     -398.149003408,  5.980077351 },
3767           {    0.032088e-6,    18849.227549974,  4.162913471 },
3768           {    0.033595e-6,     5507.553238667,  5.980162321 },
3769           {    0.029198e-6,     5856.477659115,  0.623811863 },
3770           {    0.027764e-6,      155.420399434,  3.745318113 },
3771           {    0.025190e-6,     5746.271337896,  2.980330535 },
3772           {    0.022997e-6,     -796.298006816,  1.174411803 },
3773           {    0.024976e-6,     5760.498431898,  2.467913690 },
3774        /* 491, 500 */
3775           {    0.021774e-6,      206.185548437,  3.854787540 },
3776           {    0.017925e-6,     -775.522611324,  1.092065955 },
3777           {    0.013794e-6,      426.598190876,  2.699831988 },
3778           {    0.013276e-6,     6062.663207553,  5.845801920 },
3779           {    0.011774e-6,    12036.460734888,  2.292832062 },
3780           {    0.012869e-6,     6076.890301554,  5.333425680 },
3781           {    0.012152e-6,     1059.381930189,  6.222874454 },
3782           {    0.011081e-6,       -7.113547001,  5.154724984 },
3783           {    0.010143e-6,     4694.002954708,  4.044013795 },
3784           {    0.009357e-6,     5486.777843175,  3.416081409 },
3785        /* 501, 510 */
3786           {    0.010084e-6,      522.577418094,  0.749320262 },
3787           {    0.008587e-6,    10977.078804699,  2.777152598 },
3788           {    0.008628e-6,     6275.962302991,  4.562060226 },
3789           {    0.008158e-6,     -220.412642439,  5.806891533 },
3790           {    0.007746e-6,     2544.314419883,  1.603197066 },
3791           {    0.007670e-6,     2146.165416475,  3.000200440 },
3792           {    0.007098e-6,       74.781598567,  0.443725817 },
3793           {    0.006180e-6,     -536.804512095,  1.302642751 },
3794           {    0.005818e-6,     5088.628839767,  4.827723531 },
3795           {    0.004945e-6,    -6286.598968340,  0.268305170 },
3796        /* 511, 520 */
3797           {    0.004774e-6,     1349.867409659,  5.808636673 },
3798           {    0.004687e-6,     -242.728603974,  5.154890570 },
3799           {    0.006089e-6,     1748.016413067,  4.403765209 },
3800           {    0.005975e-6,    -1194.447010225,  2.583472591 },
3801           {    0.004229e-6,      951.718406251,  0.931172179 },
3802           {    0.005264e-6,      553.569402842,  2.336107252 },
3803           {    0.003049e-6,     5643.178563677,  1.362634430 },
3804           {    0.002974e-6,     6812.766815086,  1.583012668 },
3805           {    0.003403e-6,    -2352.866153772,  2.552189886 },
3806           {    0.003030e-6,      419.484643875,  5.286473844 },
3807        /* 521, 530 */
3808           {    0.003210e-6,       -7.046236698,  1.863796539 },
3809           {    0.003058e-6,     9437.762934887,  4.226420633 },
3810           {    0.002589e-6,    12352.852604545,  1.991935820 },
3811           {    0.002927e-6,     5216.580372801,  2.319951253 },
3812           {    0.002425e-6,     5230.807466803,  3.084752833 },
3813           {    0.002656e-6,     3154.687084896,  2.487447866 },
3814           {    0.002445e-6,    10447.387839604,  2.347139160 },
3815           {    0.002990e-6,     4690.479836359,  6.235872050 },
3816           {    0.002890e-6,     5863.591206116,  0.095197563 },
3817           {    0.002498e-6,     6438.496249426,  2.994779800 },
3818        /* 531, 540 */
3819           {    0.001889e-6,     8031.092263058,  3.569003717 },
3820           {    0.002567e-6,      801.820931124,  3.425611498 },
3821           {    0.001803e-6,   -71430.695617928,  2.192295512 },
3822           {    0.001782e-6,        3.932153263,  5.180433689 },
3823           {    0.001694e-6,    -4705.732307544,  4.641779174 },
3824           {    0.001704e-6,    -1592.596013633,  3.997097652 },
3825           {    0.001735e-6,     5849.364112115,  0.417558428 },
3826           {    0.001643e-6,     8429.241266467,  2.180619584 },
3827           {    0.001680e-6,       38.133035638,  4.164529426 },
3828           {    0.002045e-6,     7084.896781115,  0.526323854 },
3829        /* 541, 550 */
3830           {    0.001458e-6,     4292.330832950,  1.356098141 },
3831           {    0.001437e-6,       20.355319399,  3.895439360 },
3832           {    0.001738e-6,     6279.552731642,  0.087484036 },
3833           {    0.001367e-6,    14143.495242431,  3.987576591 },
3834           {    0.001344e-6,     7234.794256242,  0.090454338 },
3835           {    0.001438e-6,    11499.656222793,  0.974387904 },
3836           {    0.001257e-6,     6836.645252834,  1.509069366 },
3837           {    0.001358e-6,    11513.883316794,  0.495572260 },
3838           {    0.001628e-6,     7632.943259650,  4.968445721 },
3839           {    0.001169e-6,      103.092774219,  2.838496795 },
3840        /* 551, 560 */
3841           {    0.001162e-6,     4164.311989613,  3.408387778 },
3842           {    0.001092e-6,     6069.776754553,  3.617942651 },
3843           {    0.001008e-6,    17789.845619785,  0.286350174 },
3844           {    0.001008e-6,      639.897286314,  1.610762073 },
3845           {    0.000918e-6,    10213.285546211,  5.532798067 },
3846           {    0.001011e-6,    -6256.777530192,  0.661826484 },
3847           {    0.000753e-6,    16730.463689596,  3.905030235 },
3848           {    0.000737e-6,    11926.254413669,  4.641956361 },
3849           {    0.000694e-6,     3340.612426700,  2.111120332 },
3850           {    0.000701e-6,     3894.181829542,  2.760823491 },
3851        /* 561, 570 */
3852           {    0.000689e-6,     -135.065080035,  4.768800780 },
3853           {    0.000700e-6,    13367.972631107,  5.760439898 },
3854           {    0.000664e-6,     6040.347246017,  1.051215840 },
3855           {    0.000654e-6,     5650.292110678,  4.911332503 },
3856           {    0.000788e-6,     6681.224853400,  4.699648011 },
3857           {    0.000628e-6,     5333.900241022,  5.024608847 },
3858           {    0.000755e-6,     -110.206321219,  4.370971253 },
3859           {    0.000628e-6,     6290.189396992,  3.660478857 },
3860           {    0.000635e-6,    25132.303399966,  4.121051532 },
3861           {    0.000534e-6,     5966.683980335,  1.173284524 },
3862        /* 571, 580 */
3863           {    0.000543e-6,     -433.711737877,  0.345585464 },
3864           {    0.000517e-6,    -1990.745017041,  5.414571768 },
3865           {    0.000504e-6,     5767.611978898,  2.328281115 },
3866           {    0.000485e-6,     5753.384884897,  1.685874771 },
3867           {    0.000463e-6,     7860.419392439,  5.297703006 },
3868           {    0.000604e-6,      515.463871093,  0.591998446 },
3869           {    0.000443e-6,    12168.002696575,  4.830881244 },
3870           {    0.000570e-6,      199.072001436,  3.899190272 },
3871           {    0.000465e-6,    10969.965257698,  0.476681802 },
3872           {    0.000424e-6,    -7079.373856808,  1.112242763 },
3873        /* 581, 590 */
3874           {    0.000427e-6,      735.876513532,  1.994214480 },
3875           {    0.000478e-6,    -6127.655450557,  3.778025483 },
3876           {    0.000414e-6,    10973.555686350,  5.441088327 },
3877           {    0.000512e-6,     1589.072895284,  0.107123853 },
3878           {    0.000378e-6,    10984.192351700,  0.915087231 },
3879           {    0.000402e-6,    11371.704689758,  4.107281715 },
3880           {    0.000453e-6,     9917.696874510,  1.917490952 },
3881           {    0.000395e-6,      149.563197135,  2.763124165 },
3882           {    0.000371e-6,     5739.157790895,  3.112111866 },
3883           {    0.000350e-6,    11790.629088659,  0.440639857 },
3884        /* 591, 600 */
3885           {    0.000356e-6,     6133.512652857,  5.444568842 },
3886           {    0.000344e-6,      412.371096874,  5.676832684 },
3887           {    0.000383e-6,      955.599741609,  5.559734846 },
3888           {    0.000333e-6,     6496.374945429,  0.261537984 },
3889           {    0.000340e-6,     6055.549660552,  5.975534987 },
3890           {    0.000334e-6,     1066.495477190,  2.335063907 },
3891           {    0.000399e-6,    11506.769769794,  5.321230910 },
3892           {    0.000314e-6,    18319.536584880,  2.313312404 },
3893           {    0.000424e-6,     1052.268383188,  1.211961766 },
3894           {    0.000307e-6,       63.735898303,  3.169551388 },
3895        /* 601, 610 */
3896           {    0.000329e-6,       29.821438149,  6.106912080 },
3897           {    0.000357e-6,     6309.374169791,  4.223760346 },
3898           {    0.000312e-6,    -3738.761430108,  2.180556645 },
3899           {    0.000301e-6,      309.278322656,  1.499984572 },
3900           {    0.000268e-6,    12043.574281889,  2.447520648 },
3901           {    0.000257e-6,    12491.370101415,  3.662331761 },
3902           {    0.000290e-6,      625.670192312,  1.272834584 },
3903           {    0.000256e-6,     5429.879468239,  1.913426912 },
3904           {    0.000339e-6,     3496.032826134,  4.165930011 },
3905           {    0.000283e-6,     3930.209696220,  4.325565754 },
3906        /* 611, 620 */
3907           {    0.000241e-6,    12528.018664345,  3.832324536 },
3908           {    0.000304e-6,     4686.889407707,  1.612348468 },
3909           {    0.000259e-6,    16200.772724501,  3.470173146 },
3910           {    0.000238e-6,    12139.553509107,  1.147977842 },
3911           {    0.000236e-6,     6172.869528772,  3.776271728 },
3912           {    0.000296e-6,    -7058.598461315,  0.460368852 },
3913           {    0.000306e-6,    10575.406682942,  0.554749016 },
3914           {    0.000251e-6,    17298.182327326,  0.834332510 },
3915           {    0.000290e-6,     4732.030627343,  4.759564091 },
3916           {    0.000261e-6,     5884.926846583,  0.298259862 },
3917        /* 621, 630 */
3918           {    0.000249e-6,     5547.199336460,  3.749366406 },
3919           {    0.000213e-6,    11712.955318231,  5.415666119 },
3920           {    0.000223e-6,     4701.116501708,  2.703203558 },
3921           {    0.000268e-6,     -640.877607382,  0.283670793 },
3922           {    0.000209e-6,     5636.065016677,  1.238477199 },
3923           {    0.000193e-6,    10177.257679534,  1.943251340 },
3924           {    0.000182e-6,     6283.143160294,  2.456157599 },
3925           {    0.000184e-6,     -227.526189440,  5.888038582 },
3926           {    0.000182e-6,    -6283.008539689,  0.241332086 },
3927           {    0.000228e-6,    -6284.056171060,  2.657323816 },
3928        /* 631, 640 */
3929           {    0.000166e-6,     7238.675591600,  5.930629110 },
3930           {    0.000167e-6,     3097.883822726,  5.570955333 },
3931           {    0.000159e-6,     -323.505416657,  5.786670700 },
3932           {    0.000154e-6,    -4136.910433516,  1.517805532 },
3933           {    0.000176e-6,    12029.347187887,  3.139266834 },
3934           {    0.000167e-6,    12132.439962106,  3.556352289 },
3935           {    0.000153e-6,      202.253395174,  1.463313961 },
3936           {    0.000157e-6,    17267.268201691,  1.586837396 },
3937           {    0.000142e-6,    83996.847317911,  0.022670115 },
3938           {    0.000152e-6,    17260.154654690,  0.708528947 },
3939        /* 641, 650 */
3940           {    0.000144e-6,     6084.003848555,  5.187075177 },
3941           {    0.000135e-6,     5756.566278634,  1.993229262 },
3942           {    0.000134e-6,     5750.203491159,  3.457197134 },
3943           {    0.000144e-6,     5326.786694021,  6.066193291 },
3944           {    0.000160e-6,    11015.106477335,  1.710431974 },
3945           {    0.000133e-6,     3634.621024518,  2.836451652 },
3946           {    0.000134e-6,    18073.704938650,  5.453106665 },
3947           {    0.000134e-6,     1162.474704408,  5.326898811 },
3948           {    0.000128e-6,     5642.198242609,  2.511652591 },
3949           {    0.000160e-6,      632.783739313,  5.628785365 },
3950        /* 651, 660 */
3951           {    0.000132e-6,    13916.019109642,  0.819294053 },
3952           {    0.000122e-6,    14314.168113050,  5.677408071 },
3953           {    0.000125e-6,    12359.966151546,  5.251984735 },
3954           {    0.000121e-6,     5749.452731634,  2.210924603 },
3955           {    0.000136e-6,     -245.831646229,  1.646502367 },
3956           {    0.000120e-6,     5757.317038160,  3.240883049 },
3957           {    0.000134e-6,    12146.667056108,  3.059480037 },
3958           {    0.000137e-6,     6206.809778716,  1.867105418 },
3959           {    0.000141e-6,    17253.041107690,  2.069217456 },
3960           {    0.000129e-6,    -7477.522860216,  2.781469314 },
3961        /* 661, 670 */
3962           {    0.000116e-6,     5540.085789459,  4.281176991 },
3963           {    0.000116e-6,     9779.108676125,  3.320925381 },
3964           {    0.000129e-6,     5237.921013804,  3.497704076 },
3965           {    0.000113e-6,     5959.570433334,  0.983210840 },
3966           {    0.000122e-6,     6282.095528923,  2.674938860 },
3967           {    0.000140e-6,      -11.045700264,  4.957936982 },
3968           {    0.000108e-6,    23543.230504682,  1.390113589 },
3969           {    0.000106e-6,   -12569.674818332,  0.429631317 },
3970           {    0.000110e-6,     -266.607041722,  5.501340197 },
3971           {    0.000115e-6,    12559.038152982,  4.691456618 },
3972        /* 671, 680 */
3973           {    0.000134e-6,    -2388.894020449,  0.577313584 },
3974           {    0.000109e-6,    10440.274292604,  6.218148717 },
3975           {    0.000102e-6,     -543.918059096,  1.477842615 },
3976           {    0.000108e-6,    21228.392023546,  2.237753948 },
3977           {    0.000101e-6,    -4535.059436924,  3.100492232 },
3978           {    0.000103e-6,       76.266071276,  5.594294322 },
3979           {    0.000104e-6,      949.175608970,  5.674287810 },
3980           {    0.000101e-6,    13517.870106233,  2.196632348 },
3981           {    0.000100e-6,    11933.367960670,  4.056084160 },
3982 
3983        /* T^2 */
3984           {    4.322990e-6,     6283.075849991,  2.642893748 },
3985        /* 681, 690 */
3986           {    0.406495e-6,        0.000000000,  4.712388980 },
3987           {    0.122605e-6,    12566.151699983,  2.438140634 },
3988           {    0.019476e-6,      213.299095438,  1.642186981 },
3989           {    0.016916e-6,      529.690965095,  4.510959344 },
3990           {    0.013374e-6,       -3.523118349,  1.502210314 },
3991           {    0.008042e-6,       26.298319800,  0.478549024 },
3992           {    0.007824e-6,      155.420399434,  5.254710405 },
3993           {    0.004894e-6,     5746.271337896,  4.683210850 },
3994           {    0.004875e-6,     5760.498431898,  0.759507698 },
3995           {    0.004416e-6,     5223.693919802,  6.028853166 },
3996        /* 691, 700 */
3997           {    0.004088e-6,       -7.113547001,  0.060926389 },
3998           {    0.004433e-6,    77713.771467920,  3.627734103 },
3999           {    0.003277e-6,    18849.227549974,  2.327912542 },
4000           {    0.002703e-6,     6062.663207553,  1.271941729 },
4001           {    0.003435e-6,     -775.522611324,  0.747446224 },
4002           {    0.002618e-6,     6076.890301554,  3.633715689 },
4003           {    0.003146e-6,      206.185548437,  5.647874613 },
4004           {    0.002544e-6,     1577.343542448,  6.232904270 },
4005           {    0.002218e-6,     -220.412642439,  1.309509946 },
4006           {    0.002197e-6,     5856.477659115,  2.407212349 },
4007        /* 701, 710 */
4008           {    0.002897e-6,     5753.384884897,  5.863842246 },
4009           {    0.001766e-6,      426.598190876,  0.754113147 },
4010           {    0.001738e-6,     -796.298006816,  2.714942671 },
4011           {    0.001695e-6,      522.577418094,  2.629369842 },
4012           {    0.001584e-6,     5507.553238667,  1.341138229 },
4013           {    0.001503e-6,     -242.728603974,  0.377699736 },
4014           {    0.001552e-6,     -536.804512095,  2.904684667 },
4015           {    0.001370e-6,     -398.149003408,  1.265599125 },
4016           {    0.001889e-6,    -5573.142801634,  4.413514859 },
4017           {    0.001722e-6,     6069.776754553,  2.445966339 },
4018        /* 711, 720 */
4019           {    0.001124e-6,     1059.381930189,  5.041799657 },
4020           {    0.001258e-6,      553.569402842,  3.849557278 },
4021           {    0.000831e-6,      951.718406251,  2.471094709 },
4022           {    0.000767e-6,     4694.002954708,  5.363125422 },
4023           {    0.000756e-6,     1349.867409659,  1.046195744 },
4024           {    0.000775e-6,      -11.045700264,  0.245548001 },
4025           {    0.000597e-6,     2146.165416475,  4.543268798 },
4026           {    0.000568e-6,     5216.580372801,  4.178853144 },
4027           {    0.000711e-6,     1748.016413067,  5.934271972 },
4028           {    0.000499e-6,    12036.460734888,  0.624434410 },
4029        /* 721, 730 */
4030           {    0.000671e-6,    -1194.447010225,  4.136047594 },
4031           {    0.000488e-6,     5849.364112115,  2.209679987 },
4032           {    0.000621e-6,     6438.496249426,  4.518860804 },
4033           {    0.000495e-6,    -6286.598968340,  1.868201275 },
4034           {    0.000456e-6,     5230.807466803,  1.271231591 },
4035           {    0.000451e-6,     5088.628839767,  0.084060889 },
4036           {    0.000435e-6,     5643.178563677,  3.324456609 },
4037           {    0.000387e-6,    10977.078804699,  4.052488477 },
4038           {    0.000547e-6,   161000.685737473,  2.841633844 },
4039           {    0.000522e-6,     3154.687084896,  2.171979966 },
4040        /* 731, 740 */
4041           {    0.000375e-6,     5486.777843175,  4.983027306 },
4042           {    0.000421e-6,     5863.591206116,  4.546432249 },
4043           {    0.000439e-6,     7084.896781115,  0.522967921 },
4044           {    0.000309e-6,     2544.314419883,  3.172606705 },
4045           {    0.000347e-6,     4690.479836359,  1.479586566 },
4046           {    0.000317e-6,      801.820931124,  3.553088096 },
4047           {    0.000262e-6,      419.484643875,  0.606635550 },
4048           {    0.000248e-6,     6836.645252834,  3.014082064 },
4049           {    0.000245e-6,    -1592.596013633,  5.519526220 },
4050           {    0.000225e-6,     4292.330832950,  2.877956536 },
4051        /* 741, 750 */
4052           {    0.000214e-6,     7234.794256242,  1.605227587 },
4053           {    0.000205e-6,     5767.611978898,  0.625804796 },
4054           {    0.000180e-6,    10447.387839604,  3.499954526 },
4055           {    0.000229e-6,      199.072001436,  5.632304604 },
4056           {    0.000214e-6,      639.897286314,  5.960227667 },
4057           {    0.000175e-6,     -433.711737877,  2.162417992 },
4058           {    0.000209e-6,      515.463871093,  2.322150893 },
4059           {    0.000173e-6,     6040.347246017,  2.556183691 },
4060           {    0.000184e-6,     6309.374169791,  4.732296790 },
4061           {    0.000227e-6,   149854.400134205,  5.385812217 },
4062        /* 751, 760 */
4063           {    0.000154e-6,     8031.092263058,  5.120720920 },
4064           {    0.000151e-6,     5739.157790895,  4.815000443 },
4065           {    0.000197e-6,     7632.943259650,  0.222827271 },
4066           {    0.000197e-6,       74.781598567,  3.910456770 },
4067           {    0.000138e-6,     6055.549660552,  1.397484253 },
4068           {    0.000149e-6,    -6127.655450557,  5.333727496 },
4069           {    0.000137e-6,     3894.181829542,  4.281749907 },
4070           {    0.000135e-6,     9437.762934887,  5.979971885 },
4071           {    0.000139e-6,    -2352.866153772,  4.715630782 },
4072           {    0.000142e-6,     6812.766815086,  0.513330157 },
4073        /* 761, 770 */
4074           {    0.000120e-6,    -4705.732307544,  0.194160689 },
4075           {    0.000131e-6,   -71430.695617928,  0.000379226 },
4076           {    0.000124e-6,     6279.552731642,  2.122264908 },
4077           {    0.000108e-6,    -6256.777530192,  0.883445696 },
4078 
4079        /* T^3 */
4080           {    0.143388e-6,     6283.075849991,  1.131453581 },
4081           {    0.006671e-6,    12566.151699983,  0.775148887 },
4082           {    0.001480e-6,      155.420399434,  0.480016880 },
4083           {    0.000934e-6,      213.299095438,  6.144453084 },
4084           {    0.000795e-6,      529.690965095,  2.941595619 },
4085           {    0.000673e-6,     5746.271337896,  0.120415406 },
4086        /* 771, 780 */
4087           {    0.000672e-6,     5760.498431898,  5.317009738 },
4088           {    0.000389e-6,     -220.412642439,  3.090323467 },
4089           {    0.000373e-6,     6062.663207553,  3.003551964 },
4090           {    0.000360e-6,     6076.890301554,  1.918913041 },
4091           {    0.000316e-6,      -21.340641002,  5.545798121 },
4092           {    0.000315e-6,     -242.728603974,  1.884932563 },
4093           {    0.000278e-6,      206.185548437,  1.266254859 },
4094           {    0.000238e-6,     -536.804512095,  4.532664830 },
4095           {    0.000185e-6,      522.577418094,  4.578313856 },
4096           {    0.000245e-6,    18849.227549974,  0.587467082 },
4097        /* 781, 787 */
4098           {    0.000180e-6,      426.598190876,  5.151178553 },
4099           {    0.000200e-6,      553.569402842,  5.355983739 },
4100           {    0.000141e-6,     5223.693919802,  1.336556009 },
4101           {    0.000104e-6,     5856.477659115,  4.239842759 },
4102 
4103        /* T^4 */
4104           {    0.003826e-6,     6283.075849991,  5.705257275 },
4105           {    0.000303e-6,    12566.151699983,  5.407132842 },
4106           {    0.000209e-6,      155.420399434,  1.989815753 }
4107        };
4108 
4109 
4110     /* Time since J2000.0 in Julian millennia. */
4111        t = ((date1 - DJ00) + date2) / DJM;
4112 
4113     /* ================= */
4114     /* Topocentric terms */
4115     /* ================= */
4116 
4117     /* Convert UT to local solar time in radians. */
4118        tsol = fmod(ut, 1.0) * D2PI + elong;
4119 
4120     /* FUNDAMENTAL ARGUMENTS:  Simon et al. 1994. */
4121 
4122     /* Combine time argument (millennia) with deg/arcsec factor. */
4123        w = t / 3600.0;
4124 
4125     /* Sun Mean Longitude. */
4126        elsun = fmod(280.46645683 + 1296027711.03429 * w, 360.0) * DD2R;
4127 
4128     /* Sun Mean Anomaly. */
4129        emsun = fmod(357.52910918 + 1295965810.481 * w, 360.0) * DD2R;
4130 
4131     /* Mean Elongation of Moon from Sun. */
4132        d = fmod(297.85019547 + 16029616012.090 * w, 360.0) * DD2R;
4133 
4134     /* Mean Longitude of Jupiter. */
4135        elj = fmod(34.35151874 + 109306899.89453 * w, 360.0) * DD2R;
4136 
4137     /* Mean Longitude of Saturn. */
4138        els = fmod(50.07744430 + 44046398.47038 * w, 360.0) * DD2R;
4139 
4140     /* TOPOCENTRIC TERMS:  Moyer 1981 and Murray 1983. */
4141        wt =   +  0.00029e-10 * u * sin(tsol + elsun - els)
4142               +  0.00100e-10 * u * sin(tsol - 2.0 * emsun)
4143               +  0.00133e-10 * u * sin(tsol - d)
4144               +  0.00133e-10 * u * sin(tsol + elsun - elj)
4145               -  0.00229e-10 * u * sin(tsol + 2.0 * elsun + emsun)
4146               -  0.02200e-10 * v * cos(elsun + emsun)
4147               +  0.05312e-10 * u * sin(tsol - emsun)
4148               -  0.13677e-10 * u * sin(tsol + 2.0 * elsun)
4149               -  1.31840e-10 * v * cos(elsun)
4150               +  3.17679e-10 * u * sin(tsol);
4151 
4152     /* ===================== */
4153     /* Fairhead et al. model */
4154     /* ===================== */
4155 
4156     /* T**0 */
4157        w0 = 0;
4158        for (j = 473; j >= 0; j--) {
4159           w0 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4160        }
4161 
4162     /* T**1 */
4163        w1 = 0;
4164        for (j = 678; j >= 474; j--) {
4165           w1 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4166        }
4167 
4168     /* T**2 */
4169        w2 = 0;
4170        for (j = 763; j >= 679; j--) {
4171           w2 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4172        }
4173 
4174     /* T**3 */
4175        w3 = 0;
4176        for (j = 783; j >= 764; j--) {
4177           w3 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4178        }
4179 
4180     /* T**4 */
4181        w4 = 0;
4182        for (j = 786; j >= 784; j--) {
4183           w4 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4184        }
4185 
4186     /* Multiply by powers of T and combine. */
4187        wf = t * (t * (t * (t * w4 + w3) + w2) + w1) + w0;
4188 
4189     /* Adjustments to use JPL planetary masses instead of IAU. */
4190        wj =   0.00065e-6 * sin(6069.776754 * t + 4.021194) +
4191               0.00033e-6 * sin( 213.299095 * t + 5.543132) +
4192             (-0.00196e-6 * sin(6208.294251 * t + 5.696701)) +
4193             (-0.00173e-6 * sin(  74.781599 * t + 2.435900)) +
4194               0.03638e-6 * t * t;
4195 
4196     /* ============ */
4197     /* Final result */
4198     /* ============ */
4199 
4200     /* TDB-TT in seconds. */
4201        w = wt + wf + wj;
4202 
4203        return w;
4204 
4205         }
4206     
4207 
4208     /**
4209     *  The equation of the equinoxes, compatible with IAU 2000 resolutions,
4210     *  given the nutation in longitude and the mean obliquity.
4211     *
4212     *<p>This function is derived from the International Astronomical Union's
4213     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4214     *
4215     *<p>Status:  canonical model.
4216     *
4217     *<!-- Given: -->
4218     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4219     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4220     *     @param epsa          double     mean obliquity (Note 2)
4221     *     @param dpsi          double     nutation in longitude (Note 3)
4222     *
4223     * <!-- Returned (function value): -->
4224     *  @return double    equation of the equinoxes (Note 4)
4225     *
4226     * <p>Notes:
4227     * <ol>
4228     *
4229     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4230     *     convenient way between the two arguments.  For example,
4231     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4232     *     among others:
4233     *<pre>
4234     *            date1          date2
4235     *
4236     *         2450123.7           0.0       (JD method)
4237     *         2451545.0       -1421.3       (J2000 method)
4238     *         2400000.5       50123.2       (MJD method)
4239     *         2450123.5           0.2       (date &amp; time method)
4240     *</pre>
4241     *     The JD method is the most natural and convenient to use in
4242     *     cases where the loss of several decimal digits of resolution
4243     *     is acceptable.  The J2000 method is best matched to the way
4244     *     the argument is handled internally and will deliver the
4245     *     optimum resolution.  The MJD method and the date &amp; time methods
4246     *     are both good compromises between resolution and convenience.
4247     *
4248     * <li> The obliquity, in radians, is mean of date.
4249     *
4250     * <li> The result, which is in radians, operates in the following sense:
4251     *
4252     *        Greenwich apparent ST = GMST + equation of the equinoxes
4253     *
4254     * <li> The result is compatible with the IAU 2000 resolutions.  For
4255     *     further details, see IERS Conventions 2003 and Capitaine et al.
4256     *     (2002).
4257     *</ol>
4258     *<p>Called:<ul>
4259     *     <li>{@link #jauEect00} equation of the equinoxes complementary terms
4260     * </ul>
4261     *
4262     *
4263     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4264     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4265     *     Astrophysics, 406, 1135-1149 (2003)
4266     *
4267     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4268     *     IERS Technical Note No. 32, BKG (2004)
4269     *
4270     *@version 2008 May 16
4271     *
4272     *  @since Release 20101201
4273     *
4274     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4275     */
4276     public static double jauEe00(double date1, double date2, double epsa, double dpsi)
4277     {
4278        double ee;
4279 
4280 
4281     /* Equation of the equinoxes. */
4282        ee = dpsi * cos(epsa) + jauEect00(date1, date2);
4283 
4284        return ee;
4285 
4286         }
4287     
4288 
4289     /**
4290     *  Equation of the equinoxes, compatible with IAU 2000 resolutions.
4291     *
4292     *<p>This function is derived from the International Astronomical Union's
4293     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4294     *
4295     *<p>Status:  support function.
4296     *
4297     *<!-- Given: -->
4298     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4299     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4300     *
4301     * <!-- Returned (function value): -->
4302     *  @return double    equation of the equinoxes (Note 2)
4303     *
4304     * <p>Notes:
4305     * <ol>
4306     *
4307     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4308     *     convenient way between the two arguments.  For example,
4309     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4310     *     among others:
4311     *<pre>
4312     *            date1          date2
4313     *
4314     *         2450123.7           0.0       (JD method)
4315     *         2451545.0       -1421.3       (J2000 method)
4316     *         2400000.5       50123.2       (MJD method)
4317     *         2450123.5           0.2       (date &amp; time method)
4318     *</pre>
4319     *     The JD method is the most natural and convenient to use in
4320     *     cases where the loss of several decimal digits of resolution
4321     *     is acceptable.  The J2000 method is best matched to the way
4322     *     the argument is handled internally and will deliver the
4323     *     optimum resolution.  The MJD method and the date &amp; time methods
4324     *     are both good compromises between resolution and convenience.
4325     *
4326     * <li> The result, which is in radians, operates in the following sense:
4327     *
4328     *        Greenwich apparent ST = GMST + equation of the equinoxes
4329     *
4330     * <li> The result is compatible with the IAU 2000 resolutions.  For
4331     *     further details, see IERS Conventions 2003 and Capitaine et al.
4332     *     (2002).
4333     *</ol>
4334     *<p>Called:<ul>
4335     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
4336     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
4337     *     <li>{@link #jauNut00a} nutation, IAU 2000A
4338     *     <li>{@link #jauEe00} equation of the equinoxes, IAU 2000
4339     * </ul>
4340     *<p>References:
4341     *
4342     *     <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4343     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4344     *     Astrophysics, 406, 1135-1149 (2003).
4345     *
4346     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4347     *     IERS Technical Note No. 32, BKG (2004).
4348     *
4349     *@version 2008 May 16
4350     *
4351     *  @since Release 20101201
4352     *
4353     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4354     */
4355     public static double jauEe00a(double date1, double date2)
4356     {
4357        double epsa,  ee;
4358 
4359 
4360     /* IAU 2000 precession-rate adjustments. */
4361        PrecessionDeltaTerms nutd = jauPr00(date1, date2);
4362 
4363     /* Mean obliquity, consistent with IAU 2000 precession-nutation. */
4364        epsa = jauObl80(date1, date2) + nutd.depspr;
4365 
4366     /* Nutation in longitude. */
4367        NutationTerms nut = jauNut00a(date1, date2);
4368 
4369     /* Equation of the equinoxes. */
4370        ee = jauEe00(date1, date2, epsa, nut.dpsi);
4371 
4372        return ee;
4373 
4374         }
4375     
4376 
4377     /**
4378     *  Equation of the equinoxes, compatible with IAU 2000 resolutions but
4379     *  using the truncated nutation model IAU 2000B.
4380     *
4381     *<p>This function is derived from the International Astronomical Union's
4382     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4383     *
4384     *<p>Status:  support function.
4385     *
4386     *<!-- Given: -->
4387     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4388     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4389     *
4390     * <!-- Returned (function value): -->
4391     *  @return double    equation of the equinoxes (Note 2)
4392     *
4393     * <p>Notes:
4394     * <ol>
4395     *
4396     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4397     *     convenient way between the two arguments.  For example,
4398     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4399     *     among others:
4400     *<pre>
4401     *            date1          date2
4402     *
4403     *         2450123.7           0.0       (JD method)
4404     *         2451545.0       -1421.3       (J2000 method)
4405     *         2400000.5       50123.2       (MJD method)
4406     *         2450123.5           0.2       (date &amp; time method)
4407     *</pre>
4408     *     The JD method is the most natural and convenient to use in
4409     *     cases where the loss of several decimal digits of resolution
4410     *     is acceptable.  The J2000 method is best matched to the way
4411     *     the argument is handled internally and will deliver the
4412     *     optimum resolution.  The MJD method and the date &amp; time methods
4413     *     are both good compromises between resolution and convenience.
4414     *
4415     * <li> The result, which is in radians, operates in the following sense:
4416     *
4417     *        Greenwich apparent ST = GMST + equation of the equinoxes
4418     *
4419     * <li> The result is compatible with the IAU 2000 resolutions except
4420     *     that accuracy has been compromised (1 mas) for the sake of speed.  For
4421     *     further details, see McCarthy &amp; Luzum (2001), IERS Conventions
4422     *     2003 and Capitaine et al. (2003).
4423     *</ol>
4424     *<p>Called:<ul>
4425     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
4426     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
4427     *     <li>{@link #jauNut00b} nutation, IAU 2000B
4428     *     <li>{@link #jauEe00} equation of the equinoxes, IAU 2000
4429     * </ul>
4430     *
4431     *
4432     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4433     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4434     *     Astrophysics, 406, 1135-1149 (2003)
4435     *
4436     *     <p>McCarthy, D.D. &amp; Luzum, B.J., "An abridged model of the
4437     *     precession-nutation of the celestial pole", Celestial Mechanics &amp;
4438     *     Dynamical Astronomy, 85, 37-49 (2003)
4439     *
4440     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4441     *     IERS Technical Note No. 32, BKG (2004)
4442     *
4443     *@version 2008 May 18
4444     *
4445     *  @since Release 20101201
4446     *
4447     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4448     */
4449     public static  double jauEe00b(double date1, double date2)
4450     {
4451        double  ee;
4452 
4453 
4454     /* IAU 2000 precession-rate adjustments. */
4455        PrecessionDeltaTerms nutd = jauPr00(date1, date2);
4456 
4457     /* Mean obliquity, consistent with IAU 2000 precession-nutation. */
4458        double epsa = jauObl80(date1, date2) + nutd.depspr;
4459 
4460     /* Nutation in longitude. dpsi, deps*/
4461        NutationTerms nut = jauNut00b(date1, date2 );
4462 
4463     /* Equation of the equinoxes. */
4464        ee = jauEe00(date1, date2, epsa, nut.dpsi);
4465 
4466        return ee;
4467 
4468         }
4469  
4470     /**
4471     *  Equation of the equinoxes, compatible with IAU 2000 resolutions and
4472     *  IAU 2006/2000A precession-nutation.
4473     *
4474     *<p>This function is derived from the International Astronomical Union's
4475     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4476     *
4477     *<p>Status:  support function.
4478     *
4479     *<!-- Given: -->
4480     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4481     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4482     *
4483     * <!-- Returned (function value): -->
4484     *  @return double    equation of the equinoxes (Note 2)
4485     *
4486     * <p>Notes:
4487     * <ol>
4488     *
4489     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4490     *     convenient way between the two arguments.  For example,
4491     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4492     *     among others:
4493     *<pre>
4494     *            date1          date2
4495     *
4496     *         2450123.7           0.0       (JD method)
4497     *         2451545.0       -1421.3       (J2000 method)
4498     *         2400000.5       50123.2       (MJD method)
4499     *         2450123.5           0.2       (date &amp; time method)
4500     *</pre>
4501     *     The JD method is the most natural and convenient to use in
4502     *     cases where the loss of several decimal digits of resolution
4503     *     is acceptable.  The J2000 method is best matched to the way
4504     *     the argument is handled internally and will deliver the
4505     *     optimum resolution.  The MJD method and the date &amp; time methods
4506     *     are both good compromises between resolution and convenience.
4507     *
4508     * <li> The result, which is in radians, operates in the following sense:
4509     *
4510     *        Greenwich apparent ST = GMST + equation of the equinoxes
4511     *</ol>
4512     *<p>Called:<ul>
4513     *     <li>{@link #jauAnpm} normalize angle into range +/- pi
4514     *     <li>{@link #jauGst06a} Greenwich apparent sidereal time, IAU 2006/2000A
4515     *     <li>{@link #jauGmst06} Greenwich mean sidereal time, IAU 2006
4516     * </ul>
4517     *<p>Reference:
4518     *
4519     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
4520     *     IERS Technical Note No. 32, BKG
4521     *
4522     *@version 2008 May 18
4523     *
4524     *  @since Release 20101201
4525     *
4526     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4527     */
4528     public static double jauEe06a(double date1, double date2)
4529     {
4530        double gst06a, gmst06, ee;
4531 
4532 
4533     /* Apparent and mean sidereal times. */
4534        gst06a = jauGst06a(0.0, 0.0, date1, date2);
4535        gmst06 = jauGmst06(0.0, 0.0, date1, date2);
4536 
4537     /* Equation of the equinoxes. */
4538        ee  = jauAnpm(gst06a - gmst06);
4539 
4540        return ee;
4541 
4542         }
4543  
4544     private static class TERM {
4545         final int nfa[];      /* coefficients of l,l',F,D,Om,LVe,LE,pA */
4546         final double s, c;     /* sine and cosine coefficients */
4547         public TERM(int nfa[], double s, double c) {
4548             this.nfa = nfa;
4549             this.s = s;
4550             this.c = c;
4551         }
4552        
4553      } 
4554 
4555 
4556     /**
4557     *  Equation of the equinoxes complementary terms, consistent with
4558     *  IAU 2000 resolutions.
4559     *
4560     *<p>This function is derived from the International Astronomical Union's
4561     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4562     *
4563     *<p>Status:  canonical model.
4564     *
4565     *<!-- Given: -->
4566     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4567     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4568     *
4569     * <!-- Returned (function value): -->
4570     *  @return double   complementary terms (Note 2)
4571     *
4572     * <p>Notes:
4573     * <ol>
4574     *
4575     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4576     *     convenient way between the two arguments.  For example,
4577     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4578     *     among others:
4579     *<pre>
4580     *            date1          date2
4581     *
4582     *         2450123.7           0.0       (JD method)
4583     *         2451545.0       -1421.3       (J2000 method)
4584     *         2400000.5       50123.2       (MJD method)
4585     *         2450123.5           0.2       (date &amp; time method)
4586     *</pre>
4587     *     The JD method is the most natural and convenient to use in
4588     *     cases where the loss of several decimal digits of resolution
4589     *     is acceptable.  The J2000 method is best matched to the way
4590     *     the argument is handled internally and will deliver the
4591     *     optimum resolution.  The MJD method and the date &amp; time methods
4592     *     are both good compromises between resolution and convenience.
4593     *
4594     * <li> The "complementary terms" are part of the equation of the
4595     *     equinoxes (EE), classically the difference between apparent and
4596     *     mean Sidereal Time:
4597     *
4598     *        GAST = GMST + EE
4599     *
4600     *     with:
4601     *
4602     *        EE = dpsi * cos(eps)
4603     *
4604     *     where dpsi is the nutation in longitude and eps is the obliquity
4605     *     of date.  However, if the rotation of the Earth were constant in
4606     *     an inertial frame the classical formulation would lead to
4607     *     apparent irregularities in the UT1 timescale traceable to side-
4608     *     effects of precession-nutation.  In order to eliminate these
4609     *     effects from UT1, "complementary terms" were introduced in 1994
4610     *     (IAU, 1994) and took effect from 1997 (Capitaine and Gontier,
4611     * <li>:
4612     *
4613     *        GAST = GMST + CT + EE
4614     *
4615     *     By convention, the complementary terms are included as part of
4616     *     the equation of the equinoxes rather than as part of the mean
4617     *     Sidereal Time.  This slightly compromises the "geometrical"
4618     *     interpretation of mean sidereal time but is otherwise
4619     *     inconsequential.
4620     *
4621     *     The present function computes CT in the above expression,
4622     *     compatible with IAU 2000 resolutions (Capitaine et al., 2002, and
4623     *     IERS Conventions 2003).
4624     *</ol>
4625     *<p>Called:<ul>
4626     *     <li>{@link #jauFal03} mean anomaly of the Moon
4627     *     <li>{@link #jauFalp03} mean anomaly of the Sun
4628     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
4629     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
4630     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
4631     *     <li>{@link #jauFave03} mean longitude of Venus
4632     *     <li>{@link #jauFae03} mean longitude of Earth
4633     *     <li>{@link #jauFapa03} general accumulated precession in longitude
4634     * </ul>
4635     *<p>References:
4636     *
4637     *     <p>Capitaine, N. &amp; Gontier, A.-M., Astron. Astrophys., 275,
4638     *     645-650 (1993)
4639     *
4640     *     <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4641     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4642     *     Astrophysics, 406, 1135-1149 (2003)
4643     *
4644     *     <p>IAU Resolution C7, Recommendation 3 (1994)
4645     *
4646     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4647     *     IERS Technical Note No. 32, BKG (2004)
4648     *
4649     *@version 2009 December 17
4650     *
4651     *  @since Release 20101201
4652     *
4653     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4654     */
4655     public static double jauEect00(double date1, double date2)
4656     {
4657     /* Time since J2000.0, in Julian centuries */
4658        double t;
4659 
4660     /* Miscellaneous */
4661        int i, j;
4662        double a, s0, s1;
4663 
4664     /* Fundamental arguments */
4665        double fa[] = new double[14];
4666 
4667     /* Returned value. */
4668        double eect;
4669 
4670     /* ----------------------------------------- */
4671     /* The series for the EE complementary terms */
4672     /* ----------------------------------------- */
4673 
4674 
4675     /* Terms of order t^0 */
4676        final TERM e0[] = {
4677 
4678        /* 1-10 */
4679           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0}, 2640.96e-6, -0.39e-6 ),
4680           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},   63.52e-6, -0.02e-6 ),
4681           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},   11.75e-6,  0.01e-6 ),
4682           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},   11.21e-6,  0.01e-6 ),
4683           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},   -4.55e-6,  0.00e-6 ),
4684           new TERM(new int[]{ 0,  0,  2,  0,  3,  0,  0,  0},    2.02e-6,  0.00e-6 ),
4685           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},    1.98e-6,  0.00e-6 ),
4686           new TERM(new int[]{ 0,  0,  0,  0,  3,  0,  0,  0},   -1.72e-6,  0.00e-6 ),
4687           new TERM(new int[]{ 0,  1,  0,  0,  1,  0,  0,  0},   -1.41e-6, -0.01e-6 ),
4688           new TERM(new int[]{ 0,  1,  0,  0, -1,  0,  0,  0},   -1.26e-6, -0.01e-6 ),
4689 
4690        /* 11-20 */
4691           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},   -0.63e-6,  0.00e-6 ),
4692           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},   -0.63e-6,  0.00e-6 ),
4693           new TERM(new int[]{ 0,  1,  2, -2,  3,  0,  0,  0},    0.46e-6,  0.00e-6 ),
4694           new TERM(new int[]{ 0,  1,  2, -2,  1,  0,  0,  0},    0.45e-6,  0.00e-6 ),
4695           new TERM(new int[]{ 0,  0,  4, -4,  4,  0,  0,  0},    0.36e-6,  0.00e-6 ),
4696           new TERM(new int[]{ 0,  0,  1, -1,  1, -8, 12,  0},   -0.24e-6, -0.12e-6 ),
4697           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    0.32e-6,  0.00e-6 ),
4698           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    0.28e-6,  0.00e-6 ),
4699           new TERM(new int[]{ 1,  0,  2,  0,  3,  0,  0,  0},    0.27e-6,  0.00e-6 ),
4700           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},    0.26e-6,  0.00e-6 ),
4701 
4702        /* 21-30 */
4703           new TERM(new int[]{ 0,  0,  2, -2,  0,  0,  0,  0},   -0.21e-6,  0.00e-6 ),
4704           new TERM(new int[]{ 0,  1, -2,  2, -3,  0,  0,  0},    0.19e-6,  0.00e-6 ),
4705           new TERM(new int[]{ 0,  1, -2,  2, -1,  0,  0,  0},    0.18e-6,  0.00e-6 ),
4706           new TERM(new int[]{ 0,  0,  0,  0,  0,  8,-13, -1},   -0.10e-6,  0.05e-6 ),
4707           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    0.15e-6,  0.00e-6 ),
4708           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},   -0.14e-6,  0.00e-6 ),
4709           new TERM(new int[]{ 1,  0,  0, -2,  1,  0,  0,  0},    0.14e-6,  0.00e-6 ),
4710           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},   -0.14e-6,  0.00e-6 ),
4711           new TERM(new int[]{ 1,  0,  0, -2, -1,  0,  0,  0},    0.14e-6,  0.00e-6 ),
4712           new TERM(new int[]{ 0,  0,  4, -2,  4,  0,  0,  0},    0.13e-6,  0.00e-6 ),
4713 
4714        /* 31-33 */
4715           new TERM(new int[]{ 0,  0,  2, -2,  4,  0,  0,  0},   -0.11e-6,  0.00e-6 ),
4716           new TERM(new int[]{ 1,  0, -2,  0, -3,  0,  0,  0},    0.11e-6,  0.00e-6 ),
4717           new TERM(new int[]{ 1,  0, -2,  0, -1,  0,  0,  0},    0.11e-6,  0.00e-6 )
4718        };
4719 
4720     /* Terms of order t^1 */
4721        final TERM e1[] = {
4722           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},    -0.87e-6,  0.00e-6 )
4723        };
4724 
4725     /* Number of terms in the series */
4726        final int NE0 = e0.length;
4727        final int NE1 = e1.length;
4728 
4729     /*--------------------------------------------------------------------*/
4730 
4731     /* Interval between fundamental epoch J2000.0 and current date (JC). */
4732        t = ((date1 - DJ00) + date2) / DJC;
4733 
4734     /* Fundamental Arguments (from IERS Conventions 2003) */
4735 
4736     /* Mean anomaly of the Moon. */
4737        fa[0] = jauFal03(t);
4738 
4739     /* Mean anomaly of the Sun. */
4740        fa[1] = jauFalp03(t);
4741 
4742     /* Mean longitude of the Moon minus that of the ascending node. */
4743        fa[2] = jauFaf03(t);
4744 
4745     /* Mean elongation of the Moon from the Sun. */
4746        fa[3] = jauFad03(t);
4747 
4748     /* Mean longitude of the ascending node of the Moon. */
4749        fa[4] = jauFaom03(t);
4750 
4751     /* Mean longitude of Venus. */
4752        fa[5] = jauFave03(t);
4753 
4754     /* Mean longitude of Earth. */
4755        fa[6] = jauFae03(t);
4756 
4757     /* General precession in longitude. */
4758        fa[7] = jauFapa03(t);
4759 
4760     /* Evaluate the EE complementary terms. */
4761        s0 = 0.0;
4762        s1 = 0.0;
4763 
4764        for (i = NE0-1; i >= 0; i--) {
4765           a = 0.0;
4766           for (j = 0; j < 8; j++) {
4767              a += (double)(e0[i].nfa[j]) * fa[j];
4768           }
4769           s0 += e0[i].s * sin(a) + e0[i].c * cos(a);
4770        }
4771 
4772        for (i = NE1-1; i >= 0; i--) {
4773           a = 0.0;
4774           for (j = 0; j < 8; j++) {
4775              a += (double)(e1[i].nfa[j]) * fa[j];
4776           }
4777           s1 += e1[i].s * sin(a) + e1[i].c * cos(a);
4778        }
4779 
4780        eect = (s0 + s1 * t ) * DAS2R;
4781 
4782        return eect;
4783 
4784         }
4785     
4786     /**
4787      * Reference Ellipsoid of Earth.
4788      * 
4789      * The ellipsoid parameters are returned in the form of equatorial
4790     *     radius in meters (a) and flattening (f).  The latter is a number
4791     *     around 0.00335, i.e. around 1/298.
4792     *
4793      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
4794      * 
4795      * @since AIDA Stage 1
4796      */
4797     public static class ReferenceEllipsoid{
4798         /** equatorial radius (meters, Note 2) */
4799         public double a; 
4800         /** flattening (Note 2) */
4801         public double f ;
4802         public ReferenceEllipsoid(double a, double f ) {
4803             this.a = a;
4804             this.f = f;
4805         }
4806     }
4807     /**
4808     *  Earth reference ellipsoids.
4809     *
4810     *<p>This function is derived from the International Astronomical Union's
4811     *  JSOFA (Standards of Fundamental Astronomy) software collection.
4812     *
4813     *<p>Status:  canonical.
4814     *
4815     *<!-- Given: -->
4816     *     @param n        int       ellipsoid identifier (Note 1)
4817     *
4818     *<!-- Returned: -->
4819     *     @return  a        double     <u>returned</u> equatorial radius (meters, Note 2)
4820     *              f        double     <u>returned</u> flattening (Note 2)
4821     *
4822     * <!-- Returned (function value): -->
4823     *  @throws JSOFAIllegalParameter int       status:
4824     *                          0 = OK
4825     *                         -1 = illegal identifier (Note 3)
4826     *
4827     * <p>Notes:
4828     * <ol>
4829     *
4830     * <li> The identifier n is a number that specifies the choice of
4831     *     reference ellipsoid.  The following are supported:
4832     *
4833     *        n   ellipsoid
4834     *
4835     *        1    WGS84
4836     *        2    GRS80
4837     *        3    WGS72
4838     *
4839     *     The number n has no significance outside the JSOFA software.
4840     *
4841     * <li> The ellipsoid parameters are returned in the form of equatorial
4842     *     radius in meters (a) and flattening (f).  The latter is a number
4843     *     around 0.00335, i.e. around 1/298.
4844     *
4845     * <li> For the case where an unsupported n value is supplied, zero a and
4846     *     f are returned, as well as error status.
4847     *</ol>
4848     *<p>References:
4849     *
4850     *     <p>Department of Defense World Geodetic System 1984, National
4851     *     Imagery and Mapping Agency Technical Report 8350.2, Third
4852     *     Edition, p3-2.
4853     *
4854     *     <p>Moritz, H., Bull. Geodesique 66-2, 187 (1992).
4855     *
4856     *     <p>The Department of Defense World Geodetic System 1972, World
4857     *     Geodetic System Committee, May 1974.
4858     *
4859     *     <p>Explanatory Supplement to the Astronomical Almanac,
4860     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
4861     *     p220.
4862     *
4863     *@version 2010 January 18
4864     *
4865     *  @since Release 20101201
4866     *
4867     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4868     */
4869     public static  ReferenceEllipsoid jauEform ( int n ) throws JSOFAIllegalParameter
4870     {
4871       double a,f;
4872     /* Look up a and f for the specified reference ellipsoid. */
4873        switch ( n ) {
4874        case 1:
4875 
4876        /* WGS84. */
4877           a = 6378137.0;
4878           f = 1.0 / 298.257223563;
4879           break;
4880 
4881        case 2:
4882 
4883        /* GRS80. */
4884           a = 6378137.0;
4885           f = 1.0 / 298.257222101;
4886           break;
4887 
4888        case 3:
4889 
4890        /* WGS72. */
4891           a = 6378135.0;
4892           f = 1.0 / 298.26;
4893           break;
4894 
4895        default:
4896 
4897        /* Invalid identifier. */
4898           a = 0.0;
4899           f = 0.0;
4900           throw new JSOFAIllegalParameter("illegal ellipsoid identifier", -1);
4901 
4902        }
4903 
4904     /* OK status. */
4905        return new ReferenceEllipsoid(a, f);
4906 
4907     
4908     }
4909     
4910 
4911     /**
4912     *  Equation of the origins, IAU 2006 precession and IAU 2000A nutation.
4913     *
4914     *<p>This function is derived from the International Astronomical Union's
4915     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4916     *
4917     *<p>Status:  support function.
4918     *
4919     *<!-- Given: -->
4920     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4921     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4922     *
4923     * <!-- Returned (function value): -->
4924     *  @return double    the equation of the origins in radians
4925     *
4926     * <p>Notes:
4927     * <ol>
4928     *
4929     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4930     *     convenient way between the two arguments.  For example,
4931     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4932     *     among others:
4933     *<pre>
4934     *            date1          date2
4935     *
4936     *         2450123.7           0.0       (JD method)
4937     *         2451545.0       -1421.3       (J2000 method)
4938     *         2400000.5       50123.2       (MJD method)
4939     *         2450123.5           0.2       (date &amp; time method)
4940     *</pre>
4941     *     The JD method is the most natural and convenient to use in
4942     *     cases where the loss of several decimal digits of resolution
4943     *     is acceptable.  The J2000 method is best matched to the way
4944     *     the argument is handled internally and will deliver the
4945     *     optimum resolution.  The MJD method and the date &amp; time methods
4946     *     are both good compromises between resolution and convenience.
4947     *
4948     * <li> The equation of the origins is the distance between the true
4949     *     equinox and the celestial intermediate origin and, equivalently,
4950     *     the difference between Earth rotation angle and Greenwich
4951     *     apparent sidereal time (ERA-GST).  It comprises the precession
4952     *     (since J2000.0) in right ascension plus the equation of the
4953     *     equinoxes (including the small correction terms).
4954     *</ol>
4955     *<p>Called:<ul>
4956     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
4957     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
4958     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
4959     *     <li>{@link #jauEors} equation of the origins, Given NPB matrix and s
4960     * </ul>
4961     *<p>References:
4962     *
4963     *     <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
4964     *
4965     *     <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
4966     *
4967     *@version 2008 May 16
4968     *
4969     *  @since Release 20101201
4970     *
4971     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4972     */
4973     public static double jauEo06a(double date1, double date2)
4974     {
4975        double r[][], s, eo;
4976 
4977 
4978     /* Classical nutation x precession x bias matrix. */
4979        r = jauPnm06a(date1, date2);
4980 
4981     /* Extract CIP coordinates. */
4982        CelestialIntermediatePole cip = jauBpn2xy(r);
4983 
4984     /* The CIO locator, s. */
4985        s = jauS06(date1, date2, cip.x, cip.y);
4986 
4987     /* Solve for the EO. */
4988        eo = jauEors(r, s);
4989 
4990        return eo;
4991 
4992         }
4993     
4994 
4995     /**
4996     *  Equation of the origins, given the classical NPB matrix and the
4997     *  quantity s.
4998     *
4999     *<p>This function is derived from the International Astronomical Union's
5000     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5001     *
5002     *<p>Status:  support function.
5003     *
5004     *<!-- Given: -->
5005     *     @param rnpb   double[3][3]   classical nutation x precession x bias matrix
5006     *     @param s      double         the quantity s (the CIO locator) in radians
5007     *
5008     * <!-- Returned (function value): -->
5009     *  @return double        the equation of the origins in radians.
5010     *
5011     * <p>Notes:
5012     * <ol>
5013     *
5014     * <li>  The equation of the origins is the distance between the true
5015     *      equinox and the celestial intermediate origin and, equivalently,
5016     *      the difference between Earth rotation angle and Greenwich
5017     *      apparent sidereal time (ERA-GST).  It comprises the precession
5018     *      (since J2000.0) in right ascension plus the equation of the
5019     *      equinoxes (including the small correction terms).
5020     *
5021     * <li>  The algorithm is from Wallace &amp; Capitaine (2006).
5022     *</ol>
5023     * References:
5024     *
5025     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
5026     *
5027     *    <p>Wallace, P. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
5028     *
5029     *@version 2008 May 26
5030     *
5031     *  @since Release 20101201
5032     *
5033     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5034     */
5035     public static double jauEors(double rnpb[][], double s)
5036     {
5037        double x, ax, xs, ys, zs, p, q, eo;
5038 
5039 
5040     /* Evaluate Wallace &amp; Capitaine (2006) expression (16). */
5041        x = rnpb[2][0];
5042        ax = x / (1.0 + rnpb[2][2]);
5043        xs = 1.0 - ax * x;
5044        ys = -ax * rnpb[2][1];
5045        zs = -x;
5046        p = rnpb[0][0] * xs + rnpb[0][1] * ys + rnpb[0][2] * zs;
5047        q = rnpb[1][0] * xs + rnpb[1][1] * ys + rnpb[1][2] * zs;
5048        eo = ((p != 0) || (q != 0)) ? s - atan2(q, p) : s;
5049 
5050        return eo;
5051 
5052         }
5053     
5054 
5055     /**
5056     *  Julian Date to Besselian Epoch.
5057     *
5058     *<p>This function is derived from the International Astronomical Union's
5059     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5060     *
5061     *<p>Status:  support function.
5062     *
5063     *<!-- Given: -->
5064     *     @param dj1 double      Julian Date (see note)
5065     *     @param dj2 double      Julian Date (see note) 
5066     *
5067     * <!-- Returned (function value): -->
5068     *  @return double     Besselian Epoch.
5069     *
5070     *  Note:
5071     *
5072     *     The Julian Date is supplied in two pieces, in the usual JSOFA
5073     *     manner, which is designed to preserve time resolution.  The
5074     *     Julian Date is available as a single number by adding dj1 and
5075     *     dj2.  The maximum resolution is achieved if dj1 is 2451545D0
5076     *     (J2000.0).
5077     *
5078     *<p>Reference:
5079     *
5080     *     Lieske,J.H., 1979. Astron.Astrophys.,73,282.
5081     *
5082     *@version 2009 December 16
5083     *
5084     *  @since Release 20101201
5085     *
5086     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5087     */
5088     public static double jauEpb(double dj1, double dj2)
5089     {
5090     /* J2000.0 minus B1900.0 (2415019.81352) in Julian days */
5091        final double D1900 = 36524.68648;
5092 
5093        return 1900.0 + ((dj1 - DJ00) + (dj2 + D1900)) / DTY;
5094 
5095         }
5096     
5097     /**
5098     *  Besselian Epoch to Julian Date.
5099     *
5100     *<p>This function is derived from the International Astronomical Union's
5101     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5102     *
5103     *<p>Status:  support function.
5104     *
5105     *<!-- Given: -->
5106     *     @param epb       double     Besselian Epoch (e.g. 1957.3D0)
5107     *
5108     *<!-- Returned: -->
5109     *     @return  MJD zero-point: always 2400000.5  Modified Julian Date
5110     *
5111     *  Note:
5112     *
5113     *     The Julian Date is returned in two pieces, in the usual JSOFA
5114     *     manner, which is designed to preserve time resolution.  The
5115     *     Julian Date is available as a single number by adding djm0 and
5116     *     djm.
5117     *
5118     *<p>Reference:
5119     *
5120     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
5121     *
5122     *@version 2008 May 24
5123     *
5124     *  @since Release 20101201
5125     *
5126     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5127     */
5128     public static JulianDate jauEpb2jd(double epb)
5129     {
5130         double djm0, djm;
5131        djm0 = 2400000.5;
5132        djm  =   15019.81352 + (epb - 1900.0) * DTY;
5133 
5134        return new JulianDate(djm0, djm);
5135 
5136         }
5137     
5138 
5139     /**
5140     *  Julian Date to Julian Epoch.
5141     *
5142     *<p>This function is derived from the International Astronomical Union's
5143     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5144     *
5145     *<p>Status:  support function.
5146     *
5147     *<!-- Given: -->
5148     *     @param dj1 double      Julian Date (see note)
5149     *     @param dj2 double      Julian Date (see note) 
5150     *
5151     * <!-- Returned (function value): -->
5152     *  @return double     Julian Epoch
5153     *
5154     *  Note:
5155     *
5156     *     The Julian Date is supplied in two pieces, in the usual JSOFA
5157     *     manner, which is designed to preserve time resolution.  The
5158     *     Julian Date is available as a single number by adding dj1 and
5159     *     dj2.  The maximum resolution is achieved if dj1 is 2451545D0
5160     *     (J2000.0).
5161     *
5162     *<p>Reference:
5163     *
5164     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
5165     *
5166     *@version 2009 December 16
5167     *
5168     *  @since Release 20101201
5169     *
5170     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5171     */
5172     public static double jauEpj(double dj1, double dj2)
5173     {
5174        return 2000.0 + ((dj1 - DJ00) + dj2) / DJY;
5175 
5176      }
5177     
5178 
5179     /**
5180     *  Julian Epoch to Julian Date.
5181     *
5182     *<p>This function is derived from the International Astronomical Union's
5183     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5184     *
5185     *<p>Status:  support function.
5186     *
5187     *<!-- Given: -->
5188     *     @param epj       double     Julian Epoch (e.g. 1996.8D0)
5189     *
5190     *<!-- Returned: -->
5191     *     @return  MJD zero-point: always 2400000.5  Modified Julian Date
5192     *
5193     *  Note:
5194     *
5195     *     The Julian Date is returned in two pieces, in the usual JSOFA
5196     *     manner, which is designed to preserve time resolution.  The
5197     *     Julian Date is available as a single number by adding djm0 and
5198     *     djm.
5199     *
5200     *<p>Reference:
5201     *
5202     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
5203     *
5204     *@version 2008 May 11
5205     *
5206     *  @since Release 20101201
5207     *
5208     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5209     */
5210     public static JulianDate jauEpj2jd(double epj)
5211     {
5212        double djm0, djm;
5213        djm0 = 2400000.5;
5214        djm  =   51544.5 + (epj - 2000.0) * 365.25;
5215 
5216        return new JulianDate(djm0, djm);
5217 
5218         }
5219     
5220 
5221     /*
5222      * A utility class to get round 65536 byte limit on functions in java - The static initializer is too large on its own. - So split into two classes for no real semantic reason
5223      */        
5224     static private final class Ephemeris extends SSB {
5225        
5226 
5227     /**
5228     * ----------------------
5229     * Ephemeris Coefficients
5230     * ----------------------
5231     *
5232     * The ephemeris consists of harmonic terms for predicting (i) the Sun
5233     * to Earth vector and (ii) the Solar-System-barycenter to Sun vector
5234     * respectively.  The coefficients are stored in arrays which, although
5235     * 1-demensional, contain groups of three.  Each triplet of
5236     * coefficients is the amplitude, phase and frequency for one term in
5237     * the model, and each array contains the number of terms called for by
5238     * the model.
5239     *
5240     * There are eighteen such arrays, named as follows:
5241     *<pre>
5242     *     array         model      power of T      component
5243     *
5244     *      e0x      Sun-to-Earth        0              x
5245     *      e0y      Sun-to-Earth        0              y
5246     *      e0z      Sun-to-Earth        0              z
5247     *
5248     *      e1x      Sun-to-Earth        1              x
5249     *      e1y      Sun-to-Earth        1              y
5250     *      e1z      Sun-to-Earth        1              z
5251     *
5252     *      e2x      Sun-to-Earth        2              x
5253     *      e2y      Sun-to-Earth        2              y
5254     *      e2z      Sun-to-Earth        2              z
5255     *
5256     *      s0x      SSB-to-Sun          0              x
5257     *      s0y      SSB-to-Sun          0              y
5258     *      s0z      SSB-to-Sun          0              z
5259     *
5260     *      s1x      SSB-to-Sun          1              x
5261     *      s1y      SSB-to-Sun          1              y
5262     *      s1z      SSB-to-Sun          1              z
5263     *
5264     *      s2x      SSB-to-Sun          2              x
5265     *      s2y      SSB-to-Sun          2              y
5266     *      s2z      SSB-to-Sun          2              z
5267     *<pre>
5268     */
5269 
5270     /* Sun-to-Earth, T^0, X */
5271       static final double e0x[] = {
5272           0.9998292878132e+00, 0.1753485171504e+01, 0.6283075850446e+01,
5273           0.8352579567414e-02, 0.1710344404582e+01, 0.1256615170089e+02,
5274           0.5611445335148e-02, 0.0000000000000e+00, 0.0000000000000e+00,
5275           0.1046664295572e-03, 0.1667225416770e+01, 0.1884922755134e+02,
5276           0.3110842534677e-04, 0.6687513390251e+00, 0.8399684731857e+02,
5277           0.2552413503550e-04, 0.5830637358413e+00, 0.5296909721118e+00,
5278           0.2137207845781e-04, 0.1092330954011e+01, 0.1577343543434e+01,
5279           0.1680240182951e-04, 0.4955366134987e+00, 0.6279552690824e+01,
5280           0.1679012370795e-04, 0.6153014091901e+01, 0.6286599010068e+01,
5281           0.1445526946777e-04, 0.3472744100492e+01, 0.2352866153506e+01,
5282 
5283           0.1091038246184e-04, 0.3689845786119e+01, 0.5223693906222e+01,
5284           0.9344399733932e-05, 0.6073934645672e+01, 0.1203646072878e+02,
5285           0.8993182910652e-05, 0.3175705249069e+01, 0.1021328554739e+02,
5286           0.5665546034116e-05, 0.2152484672246e+01, 0.1059381944224e+01,
5287           0.6844146703035e-05, 0.1306964099750e+01, 0.5753384878334e+01,
5288           0.7346610905565e-05, 0.4354980070466e+01, 0.3981490189893e+00,
5289           0.6815396474414e-05, 0.2218229211267e+01, 0.4705732307012e+01,
5290           0.6112787253053e-05, 0.5384788425458e+01, 0.6812766822558e+01,
5291           0.4518120711239e-05, 0.6087604012291e+01, 0.5884926831456e+01,
5292           0.4521963430706e-05, 0.1279424524906e+01, 0.6256777527156e+01,
5293 
5294           0.4497426764085e-05, 0.5369129144266e+01, 0.6309374173736e+01,
5295           0.4062190566959e-05, 0.5436473303367e+00, 0.6681224869435e+01,
5296           0.5412193480192e-05, 0.7867838528395e+00, 0.7755226100720e+00,
5297           0.5469839049386e-05, 0.1461440311134e+01, 0.1414349524433e+02,
5298           0.5205264083477e-05, 0.4432944696116e+01, 0.7860419393880e+01,
5299           0.2149759935455e-05, 0.4502237496846e+01, 0.1150676975667e+02,
5300           0.2279109618501e-05, 0.1239441308815e+01, 0.7058598460518e+01,
5301           0.2259282939683e-05, 0.3272430985331e+01, 0.4694002934110e+01,
5302           0.2558950271319e-05, 0.2265471086404e+01, 0.1216800268190e+02,
5303           0.2561581447555e-05, 0.1454740653245e+01, 0.7099330490126e+00,
5304 
5305           0.1781441115440e-05, 0.2962068630206e+01, 0.7962980379786e+00,
5306           0.1612005874644e-05, 0.1473255041006e+01, 0.5486777812467e+01,
5307           0.1818630667105e-05, 0.3743903293447e+00, 0.6283008715021e+01,
5308           0.1818601377529e-05, 0.6274174354554e+01, 0.6283142985870e+01,
5309           0.1554475925257e-05, 0.1624110906816e+01, 0.2513230340178e+02,
5310           0.2090948029241e-05, 0.5852052276256e+01, 0.1179062909082e+02,
5311           0.2000176345460e-05, 0.4072093298513e+01, 0.1778984560711e+02,
5312           0.1289535917759e-05, 0.5217019331069e+01, 0.7079373888424e+01,
5313           0.1281135307881e-05, 0.4802054538934e+01, 0.3738761453707e+01,
5314           0.1518229005692e-05, 0.8691914742502e+00, 0.2132990797783e+00,
5315 
5316           0.9450128579027e-06, 0.4601859529950e+01, 0.1097707878456e+02,
5317           0.7781119494996e-06, 0.1844352816694e+01, 0.8827390247185e+01,
5318           0.7733407759912e-06, 0.3582790154750e+01, 0.5507553240374e+01,
5319           0.7350644318120e-06, 0.2695277788230e+01, 0.1589072916335e+01,
5320           0.6535928827023e-06, 0.3651327986142e+01, 0.1176985366291e+02,
5321           0.6324624183656e-06, 0.2241302375862e+01, 0.6262300422539e+01,
5322           0.6298565300557e-06, 0.4407122406081e+01, 0.6303851278352e+01,
5323           0.8587037089179e-06, 0.3024307223119e+01, 0.1672837615881e+03,
5324           0.8299954491035e-06, 0.6192539428237e+01, 0.3340612434717e+01,
5325           0.6311263503401e-06, 0.2014758795416e+01, 0.7113454667900e-02,
5326 
5327           0.6005646745452e-06, 0.3399500503397e+01, 0.4136910472696e+01,
5328           0.7917715109929e-06, 0.2493386877837e+01, 0.6069776770667e+01,
5329           0.7556958099685e-06, 0.4159491740143e+01, 0.6496374930224e+01,
5330           0.6773228244949e-06, 0.4034162934230e+01, 0.9437762937313e+01,
5331           0.5370708577847e-06, 0.1562219163734e+01, 0.1194447056968e+01,
5332           0.5710804266203e-06, 0.2662730803386e+01, 0.6282095334605e+01,
5333           0.5709824583726e-06, 0.3985828430833e+01, 0.6284056366286e+01,
5334           0.5143950896447e-06, 0.1308144688689e+01, 0.6290189305114e+01,
5335           0.5088010604546e-06, 0.5352817214804e+01, 0.6275962395778e+01,
5336           0.4960369085172e-06, 0.2644267922349e+01, 0.6127655567643e+01,
5337 
5338           0.4803137891183e-06, 0.4008844192080e+01, 0.6438496133249e+01,
5339           0.5731747768225e-06, 0.3794550174597e+01, 0.3154687086868e+01,
5340           0.4735947960579e-06, 0.6107118308982e+01, 0.3128388763578e+01,
5341           0.4808348796625e-06, 0.4771458618163e+01, 0.8018209333619e+00,
5342           0.4115073743137e-06, 0.3327111335159e+01, 0.8429241228195e+01,
5343           0.5230575889287e-06, 0.5305708551694e+01, 0.1336797263425e+02,
5344           0.5133977889215e-06, 0.5784230738814e+01, 0.1235285262111e+02,
5345           0.5065815825327e-06, 0.2052064793679e+01, 0.1185621865188e+02,
5346           0.4339831593868e-06, 0.3644994195830e+01, 0.1726015463500e+02,
5347           0.3952928638953e-06, 0.4930376436758e+01, 0.5481254917084e+01,
5348 
5349           0.4898498111942e-06, 0.4542084219731e+00, 0.9225539266174e+01,
5350           0.4757490209328e-06, 0.3161126388878e+01, 0.5856477690889e+01,
5351           0.4727701669749e-06, 0.6214993845446e+00, 0.2544314396739e+01,
5352           0.3800966681863e-06, 0.3040132339297e+01, 0.4265981595566e+00,
5353           0.3257301077939e-06, 0.8064977360087e+00, 0.3930209696940e+01,
5354           0.3255810528674e-06, 0.1974147981034e+01, 0.2146165377750e+01,
5355           0.3252029748187e-06, 0.2845924913135e+01, 0.4164311961999e+01,
5356           0.3255505635308e-06, 0.3017900824120e+01, 0.5088628793478e+01,
5357           0.2801345211990e-06, 0.6109717793179e+01, 0.1256967486051e+02,
5358           0.3688987740970e-06, 0.2911550235289e+01, 0.1807370494127e+02,
5359 
5360           0.2475153429458e-06, 0.2179146025856e+01, 0.2629832328990e-01,
5361           0.3033457749150e-06, 0.1994161050744e+01, 0.4535059491685e+01,
5362           0.2186743763110e-06, 0.5125687237936e+01, 0.1137170464392e+02,
5363           0.2764777032774e-06, 0.4822646860252e+00, 0.1256262854127e+02,
5364           0.2199028768592e-06, 0.4637633293831e+01, 0.1255903824622e+02,
5365           0.2046482824760e-06, 0.1467038733093e+01, 0.7084896783808e+01,
5366           0.2611209147507e-06, 0.3044718783485e+00, 0.7143069561767e+02,
5367           0.2286079656818e-06, 0.4764220356805e+01, 0.8031092209206e+01,
5368           0.1855071202587e-06, 0.3383637774428e+01, 0.1748016358760e+01,
5369           0.2324669506784e-06, 0.6189088449251e+01, 0.1831953657923e+02,
5370 
5371           0.1709528015688e-06, 0.5874966729774e+00, 0.4933208510675e+01,
5372           0.2168156875828e-06, 0.4302994009132e+01, 0.1044738781244e+02,
5373           0.2106675556535e-06, 0.3800475419891e+01, 0.7477522907414e+01,
5374           0.1430213830465e-06, 0.1294660846502e+01, 0.2942463415728e+01,
5375           0.1388396901944e-06, 0.4594797202114e+01, 0.8635942003952e+01,
5376           0.1922258844190e-06, 0.4943044543591e+00, 0.1729818233119e+02,
5377           0.1888460058292e-06, 0.2426943912028e+01, 0.1561374759853e+03,
5378           0.1789449386107e-06, 0.1582973303499e+00, 0.1592596075957e+01,
5379           0.1360803685374e-06, 0.5197240440504e+01, 0.1309584267300e+02,
5380           0.1504038014709e-06, 0.3120360916217e+01, 0.1649636139783e+02,
5381 
5382           0.1382769533389e-06, 0.6164702888205e+01, 0.7632943190217e+01,
5383           0.1438059769079e-06, 0.1437423770979e+01, 0.2042657109477e+02,
5384           0.1326303260037e-06, 0.3609688799679e+01, 0.1213955354133e+02,
5385           0.1159244950540e-06, 0.5463018167225e+01, 0.5331357529664e+01,
5386           0.1433118149136e-06, 0.6028909912097e+01, 0.7342457794669e+01,
5387           0.1234623148594e-06, 0.3109645574997e+01, 0.6279485555400e+01,
5388           0.1233949875344e-06, 0.3539359332866e+01, 0.6286666145492e+01,
5389           0.9927196061299e-07, 0.1259321569772e+01, 0.7234794171227e+01,
5390           0.1242302191316e-06, 0.1065949392609e+01, 0.1511046609763e+02,
5391           0.1098402195201e-06, 0.2192508743837e+01, 0.1098880815746e+02,
5392 
5393           0.1158191395315e-06, 0.4054411278650e+01, 0.5729506548653e+01,
5394           0.9048475596241e-07, 0.5429764748518e+01, 0.9623688285163e+01,
5395           0.8889853269023e-07, 0.5046586206575e+01, 0.6148010737701e+01,
5396           0.1048694242164e-06, 0.2628858030806e+01, 0.6836645152238e+01,
5397           0.1112308378646e-06, 0.4177292719907e+01, 0.1572083878776e+02,
5398           0.8631729709901e-07, 0.1601345232557e+01, 0.6418140963190e+01,
5399           0.8527816951664e-07, 0.2463888997513e+01, 0.1471231707864e+02,
5400           0.7892139456991e-07, 0.3154022088718e+01, 0.2118763888447e+01,
5401           0.1051782905236e-06, 0.4795035816088e+01, 0.1349867339771e+01,
5402           0.1048219943164e-06, 0.2952983395230e+01, 0.5999216516294e+01,
5403 
5404           0.7435760775143e-07, 0.5420547991464e+01, 0.6040347114260e+01,
5405           0.9869574106949e-07, 0.3695646753667e+01, 0.6566935184597e+01,
5406           0.9156886364226e-07, 0.3922675306609e+01, 0.5643178611111e+01,
5407           0.7006834356188e-07, 0.1233968624861e+01, 0.6525804586632e+01,
5408           0.9806170182601e-07, 0.1919542280684e+01, 0.2122839202813e+02,
5409           0.9052289673607e-07, 0.4615902724369e+01, 0.4690479774488e+01,
5410           0.7554200867893e-07, 0.1236863719072e+01, 0.1253985337760e+02,
5411           0.8215741286498e-07, 0.3286800101559e+00, 0.1097355562493e+02,
5412           0.7185178575397e-07, 0.5880942158367e+01, 0.6245048154254e+01,
5413           0.7130726476180e-07, 0.7674871987661e+00, 0.6321103546637e+01,
5414 
5415           0.6650894461162e-07, 0.6987129150116e+00, 0.5327476111629e+01,
5416           0.7396888823688e-07, 0.3576824794443e+01, 0.5368044267797e+00,
5417           0.7420588884775e-07, 0.5033615245369e+01, 0.2354323048545e+02,
5418           0.6141181642908e-07, 0.9449927045673e+00, 0.1296430071988e+02,
5419           0.6373557924058e-07, 0.6206342280341e+01, 0.9517183207817e+00,
5420           0.6359474329261e-07, 0.5036079095757e+01, 0.1990745094947e+01,
5421           0.5740173582646e-07, 0.6105106371350e+01, 0.9555997388169e+00,
5422           0.7019864084602e-07, 0.7237747359018e+00, 0.5225775174439e+00,
5423           0.6398054487042e-07, 0.3976367969666e+01, 0.2407292145756e+02,
5424           0.7797092650498e-07, 0.4305423910623e+01, 0.2200391463820e+02,
5425 
5426           0.6466760000900e-07, 0.3500136825200e+01, 0.5230807360890e+01,
5427           0.7529417043890e-07, 0.3514779246100e+01, 0.1842262939178e+02,
5428           0.6924571140892e-07, 0.2743457928679e+01, 0.1554202828031e+00,
5429           0.6220798650222e-07, 0.2242598118209e+01, 0.1845107853235e+02,
5430           0.5870209391853e-07, 0.2332832707527e+01, 0.6398972393349e+00,
5431           0.6263953473888e-07, 0.2191105358956e+01, 0.6277552955062e+01,
5432           0.6257781390012e-07, 0.4457559396698e+01, 0.6288598745829e+01,
5433           0.5697304945123e-07, 0.3499234761404e+01, 0.1551045220144e+01,
5434           0.6335438746791e-07, 0.6441691079251e+00, 0.5216580451554e+01,
5435           0.6377258441152e-07, 0.2252599151092e+01, 0.5650292065779e+01,
5436 
5437           0.6484841818165e-07, 0.1992812417646e+01, 0.1030928125552e+00,
5438           0.4735551485250e-07, 0.3744672082942e+01, 0.1431416805965e+02,
5439           0.4628595996170e-07, 0.1334226211745e+01, 0.5535693017924e+00,
5440           0.6258152336933e-07, 0.4395836159154e+01, 0.2608790314060e+02,
5441           0.6196171366594e-07, 0.2587043007997e+01, 0.8467247584405e+02,
5442           0.6159556952126e-07, 0.4782499769128e+01, 0.2394243902548e+03,
5443           0.4987741172394e-07, 0.7312257619924e+00, 0.7771377146812e+02,
5444           0.5459280703142e-07, 0.3001376372532e+01, 0.6179983037890e+01,
5445           0.4863461189999e-07, 0.3767222128541e+01, 0.9027992316901e+02,
5446           0.5349912093158e-07, 0.3663594450273e+01, 0.6386168663001e+01,
5447 
5448           0.5673725607806e-07, 0.4331187919049e+01, 0.6915859635113e+01,
5449           0.4745485060512e-07, 0.5816195745518e+01, 0.6282970628506e+01,
5450           0.4745379005326e-07, 0.8323672435672e+00, 0.6283181072386e+01,
5451           0.4049002796321e-07, 0.3785023976293e+01, 0.6254626709878e+01,
5452           0.4247084014515e-07, 0.2378220728783e+01, 0.7875671926403e+01,
5453           0.4026912363055e-07, 0.2864103423269e+01, 0.6311524991013e+01,
5454           0.4062935011774e-07, 0.2415408595975e+01, 0.3634620989887e+01,
5455           0.5347771048509e-07, 0.3343479309801e+01, 0.2515860172507e+02,
5456           0.4829494136505e-07, 0.2821742398262e+01, 0.5760498333002e+01,
5457           0.4342554404599e-07, 0.5624662458712e+01, 0.7238675589263e+01,
5458 
5459           0.4021599184361e-07, 0.5557250275009e+00, 0.1101510648075e+02,
5460           0.4104900474558e-07, 0.3296691780005e+01, 0.6709674010002e+01,
5461           0.4376532905131e-07, 0.3814443999443e+01, 0.6805653367890e+01,
5462           0.3314590480650e-07, 0.3560229189250e+01, 0.1259245002418e+02,
5463           0.3232421839643e-07, 0.5185389180568e+01, 0.1066495398892e+01,
5464           0.3541176318876e-07, 0.3921381909679e+01, 0.9917696840332e+01,
5465           0.3689831242681e-07, 0.4190658955386e+01, 0.1192625446156e+02,
5466           0.3890605376774e-07, 0.5546023371097e+01, 0.7478166569050e-01,
5467           0.3038559339780e-07, 0.6231032794494e+01, 0.1256621883632e+02,
5468           0.3137083969782e-07, 0.6207063419190e+01, 0.4292330755499e+01,
5469 
5470           0.4024004081854e-07, 0.1195257375713e+01, 0.1334167431096e+02,
5471           0.3300234879283e-07, 0.1804694240998e+01, 0.1057540660594e+02,
5472           0.3635399155575e-07, 0.5597811343500e+01, 0.6208294184755e+01,
5473           0.3032668691356e-07, 0.3191059366530e+01, 0.1805292951336e+02,
5474           0.2809652069058e-07, 0.4094348032570e+01, 0.3523159621801e-02,
5475           0.3696955383823e-07, 0.5219282738794e+01, 0.5966683958112e+01,
5476           0.3562894142503e-07, 0.1037247544554e+01, 0.6357857516136e+01,
5477           0.3510598524148e-07, 0.1430020816116e+01, 0.6599467742779e+01,
5478           0.3617736142953e-07, 0.3002911403677e+01, 0.6019991944201e+01,
5479           0.2624524910730e-07, 0.2437046757292e+01, 0.6702560555334e+01,
5480 
5481           0.2535824204490e-07, 0.1581594689647e+01, 0.3141537925223e+02,
5482           0.3519787226257e-07, 0.5379863121521e+01, 0.2505706758577e+03,
5483           0.2578406709982e-07, 0.4904222639329e+01, 0.1673046366289e+02,
5484           0.3423887981473e-07, 0.3646448997315e+01, 0.6546159756691e+01,
5485           0.2776083886467e-07, 0.3307829300144e+01, 0.1272157198369e+02,
5486           0.3379592818379e-07, 0.1747541251125e+01, 0.1494531617769e+02,
5487           0.3050255426284e-07, 0.1784689432607e-01, 0.4732030630302e+01,
5488           0.2652378350236e-07, 0.4420055276260e+01, 0.5863591145557e+01,
5489           0.2374498173768e-07, 0.3629773929208e+01, 0.2388894113936e+01,
5490           0.2716451255140e-07, 0.3079623706780e+01, 0.1202934727411e+02,
5491 
5492           0.3038583699229e-07, 0.3312487903507e+00, 0.1256608456547e+02,
5493           0.2220681228760e-07, 0.5265520401774e+01, 0.1336244973887e+02,
5494           0.3044156540912e-07, 0.4766664081250e+01, 0.2908881142201e+02,
5495           0.2731859923561e-07, 0.5069146530691e+01, 0.1391601904066e+02,
5496           0.2285603018171e-07, 0.5954935112271e+01, 0.6076890225335e+01,
5497           0.2025006454555e-07, 0.4061789589267e+01, 0.4701116388778e+01,
5498           0.2012597519804e-07, 0.2485047705241e+01, 0.6262720680387e+01,
5499           0.2003406962258e-07, 0.4163779209320e+01, 0.6303431020504e+01,
5500           0.2207863441371e-07, 0.6923839133828e+00, 0.6489261475556e+01,
5501           0.2481374305624e-07, 0.5944173595676e+01, 0.1204357418345e+02,
5502 
5503           0.2130923288870e-07, 0.4641013671967e+01, 0.5746271423666e+01,
5504           0.2446370543391e-07, 0.6125796518757e+01, 0.1495633313810e+00,
5505           0.1932492759052e-07, 0.2234572324504e+00, 0.1352175143971e+02,
5506           0.2600122568049e-07, 0.4281012405440e+01, 0.4590910121555e+01,
5507           0.2431754047488e-07, 0.1429943874870e+00, 0.1162474756779e+01,
5508           0.1875902869209e-07, 0.9781803816948e+00, 0.6279194432410e+01,
5509           0.1874381139426e-07, 0.5670368130173e+01, 0.6286957268481e+01,
5510           0.2156696047173e-07, 0.2008985006833e+01, 0.1813929450232e+02,
5511           0.1965076182484e-07, 0.2566186202453e+00, 0.4686889479442e+01,
5512           0.2334816372359e-07, 0.4408121891493e+01, 0.1002183730415e+02,
5513 
5514           0.1869937408802e-07, 0.5272745038656e+01, 0.2427287361862e+00,
5515           0.2436236460883e-07, 0.4407720479029e+01, 0.9514313292143e+02,
5516           0.1761365216611e-07, 0.1943892315074e+00, 0.1351787002167e+02,
5517           0.2156289480503e-07, 0.1418570924545e+01, 0.6037244212485e+01,
5518           0.2164748979255e-07, 0.4724603439430e+01, 0.2301353951334e+02,
5519           0.2222286670853e-07, 0.2400266874598e+01, 0.1266924451345e+02,
5520           0.2070901414929e-07, 0.5230348028732e+01, 0.6528907488406e+01,
5521           0.1792745177020e-07, 0.2099190328945e+01, 0.6819880277225e+01,
5522           0.1841802068445e-07, 0.3467527844848e+00, 0.6514761976723e+02,
5523           0.1578401631718e-07, 0.7098642356340e+00, 0.2077542790660e-01,
5524 
5525           0.1561690152531e-07, 0.5943349620372e+01, 0.6272439236156e+01,
5526           0.1558591045463e-07, 0.7040653478980e+00, 0.6293712464735e+01,
5527           0.1737356469576e-07, 0.4487064760345e+01, 0.1765478049437e+02,
5528           0.1434755619991e-07, 0.2993391570995e+01, 0.1102062672231e+00,
5529           0.1482187806654e-07, 0.2278049198251e+01, 0.1052268489556e+01,
5530           0.1424812827089e-07, 0.1682114725827e+01, 0.1311972100268e+02,
5531           0.1380282448623e-07, 0.3262668602579e+01, 0.1017725758696e+02,
5532           0.1811481244566e-07, 0.3187771221777e+01, 0.1887552587463e+02,
5533           0.1504446185696e-07, 0.5650162308647e+01, 0.7626583626240e-01,
5534           0.1740776154137e-07, 0.5487068607507e+01, 0.1965104848470e+02,
5535 
5536           0.1374339536251e-07, 0.5745688172201e+01, 0.6016468784579e+01,
5537           0.1761377477704e-07, 0.5748060203659e+01, 0.2593412433514e+02,
5538           0.1535138225795e-07, 0.6226848505790e+01, 0.9411464614024e+01,
5539           0.1788140543676e-07, 0.6189318878563e+01, 0.3301902111895e+02,
5540           0.1375002807996e-07, 0.5371812884394e+01, 0.6327837846670e+00,
5541           0.1242115758632e-07, 0.1471687569712e+01, 0.3894181736510e+01,
5542           0.1450977333938e-07, 0.4143836662127e+01, 0.1277945078067e+02,
5543           0.1297579575023e-07, 0.9003477661957e+00, 0.6549682916313e+01,
5544           0.1462667934821e-07, 0.5760505536428e+01, 0.1863592847156e+02,
5545           0.1381774374799e-07, 0.1085471729463e+01, 0.2379164476796e+01,
5546 
5547           0.1682333169307e-07, 0.5409870870133e+01, 0.1620077269078e+02,
5548           0.1190812918837e-07, 0.1397205174601e+01, 0.1149965630200e+02,
5549           0.1221434762106e-07, 0.9001804809095e+00, 0.1257326515556e+02,
5550           0.1549934644860e-07, 0.4262528275544e+01, 0.1820933031200e+02,
5551           0.1252138953050e-07, 0.1411642012027e+01, 0.6993008899458e+01,
5552           0.1237078905387e-07, 0.2844472403615e+01, 0.2435678079171e+02,
5553           0.1446953389615e-07, 0.5295835522223e+01, 0.3813291813120e-01,
5554           0.1388446457170e-07, 0.4969428135497e+01, 0.2458316379602e+00,
5555           0.1019339179228e-07, 0.2491369561806e+01, 0.6112403035119e+01,
5556           0.1258880815343e-07, 0.4679426248976e+01, 0.5429879531333e+01,
5557 
5558           0.1297768238261e-07, 0.1074509953328e+01, 0.1249137003520e+02,
5559           0.9913505718094e-08, 0.4735097918224e+01, 0.6247047890016e+01,
5560           0.9830453155969e-08, 0.4158649187338e+01, 0.6453748665772e+01,
5561           0.1192615865309e-07, 0.3438208613699e+01, 0.6290122169689e+01,
5562           0.9835874798277e-08, 0.1913300781229e+01, 0.6319103810876e+01,
5563           0.9639087569277e-08, 0.9487683644125e+00, 0.8273820945392e+01,
5564           0.1175716107001e-07, 0.3228141664287e+01, 0.6276029531202e+01,
5565           0.1018926508678e-07, 0.2216607854300e+01, 0.1254537627298e+02,
5566           0.9500087869225e-08, 0.2625116459733e+01, 0.1256517118505e+02,
5567           0.9664192916575e-08, 0.5860562449214e+01, 0.6259197520765e+01,
5568 
5569           0.9612858712203e-08, 0.7885682917381e+00, 0.6306954180126e+01,
5570           0.1117645675413e-07, 0.3932148831189e+01, 0.1779695906178e+02,
5571           0.1158864052160e-07, 0.9995605521691e+00, 0.1778273215245e+02,
5572           0.9021043467028e-08, 0.5263769742673e+01, 0.6172869583223e+01,
5573           0.8836134773563e-08, 0.1496843220365e+01, 0.1692165728891e+01,
5574           0.1045872200691e-07, 0.7009039517214e+00, 0.2204125344462e+00,
5575           0.1211463487798e-07, 0.4041544938511e+01, 0.8257698122054e+02,
5576           0.8541990804094e-08, 0.1447586692316e+01, 0.6393282117669e+01,
5577           0.1038720703636e-07, 0.4594249718112e+00, 0.1550861511662e+02,
5578           0.1126722351445e-07, 0.3925550579036e+01, 0.2061856251104e+00,
5579 
5580           0.8697373859631e-08, 0.4411341856037e+01, 0.9491756770005e+00,
5581           0.8869380028441e-08, 0.2402659724813e+01, 0.3903911373650e+01,
5582           0.9247014693258e-08, 0.1401579743423e+01, 0.6267823317922e+01,
5583           0.9205062930950e-08, 0.5245978000814e+01, 0.6298328382969e+01,
5584           0.8000745038049e-08, 0.3590803356945e+01, 0.2648454860559e+01,
5585           0.9168973650819e-08, 0.2470150501679e+01, 0.1498544001348e+03,
5586           0.1075444949238e-07, 0.1328606161230e+01, 0.3694923081589e+02,
5587           0.7817298525817e-08, 0.6162256225998e+01, 0.4804209201333e+01,
5588           0.9541469226356e-08, 0.3942568967039e+01, 0.1256713221673e+02,
5589           0.9821910122027e-08, 0.2360246287233e+00, 0.1140367694411e+02,
5590 
5591           0.9897822023777e-08, 0.4619805634280e+01, 0.2280573557157e+02,
5592           0.7737289283765e-08, 0.3784727847451e+01, 0.7834121070590e+01,
5593           0.9260204034710e-08, 0.2223352487601e+01, 0.2787043132925e+01,
5594           0.7320252888486e-08, 0.1288694636874e+01, 0.6282655592598e+01,
5595           0.7319785780946e-08, 0.5359869567774e+01, 0.6283496108294e+01,
5596           0.7147219933778e-08, 0.5516616675856e+01, 0.1725663147538e+02,
5597           0.7946502829878e-08, 0.2630459984567e+01, 0.1241073141809e+02,
5598           0.9001711808932e-08, 0.2849815827227e+01, 0.6281591679874e+01,
5599           0.8994041507257e-08, 0.3795244450750e+01, 0.6284560021018e+01,
5600           0.8298582787358e-08, 0.5236413127363e+00, 0.1241658836951e+02,
5601 
5602           0.8526596520710e-08, 0.4794605424426e+01, 0.1098419223922e+02,
5603           0.8209822103197e-08, 0.1578752370328e+01, 0.1096996532989e+02,
5604           0.6357049861094e-08, 0.5708926113761e+01, 0.1596186371003e+01,
5605           0.7370473179049e-08, 0.3842402530241e+01, 0.4061219149443e+01,
5606           0.7232154664726e-08, 0.3067548981535e+01, 0.1610006857377e+03,
5607           0.6328765494903e-08, 0.1313930030069e+01, 0.1193336791622e+02,
5608           0.8030064908595e-08, 0.3488500408886e+01, 0.8460828644453e+00,
5609           0.6275464259232e-08, 0.1532061626198e+01, 0.8531963191132e+00,
5610           0.7051897446325e-08, 0.3285859929993e+01, 0.5849364236221e+01,
5611           0.6161593705428e-08, 0.1477341999464e+01, 0.5573142801433e+01,
5612 
5613           0.7754683957278e-08, 0.1586118663096e+01, 0.8662240327241e+01,
5614           0.5889928990701e-08, 0.1304887868803e+01, 0.1232342296471e+02,
5615           0.5705756047075e-08, 0.4555333589350e+01, 0.1258692712880e+02,
5616           0.5964178808332e-08, 0.3001762842062e+01, 0.5333900173445e+01,
5617           0.6712446027467e-08, 0.4886780007595e+01, 0.1171295538178e+02,
5618           0.5941809275464e-08, 0.4701509603824e+01, 0.9779108567966e+01,
5619           0.5466993627395e-08, 0.4588357817278e+01, 0.1884211409667e+02,
5620           0.6340512090980e-08, 0.1164543038893e+01, 0.5217580628120e+02,
5621           0.6325505710045e-08, 0.3919171259645e+01, 0.1041998632314e+02,
5622           0.6164789509685e-08, 0.2143828253542e+01, 0.6151533897323e+01,
5623 
5624           0.5263330812430e-08, 0.6066564434241e+01, 0.1885275071096e+02,
5625           0.5597087780221e-08, 0.2926316429472e+01, 0.4337116142245e+00,
5626           0.5396556236817e-08, 0.3244303591505e+01, 0.6286362197481e+01,
5627           0.5396615148223e-08, 0.3404304703662e+01, 0.6279789503410e+01,
5628           0.7091832443341e-08, 0.8532377803192e+00, 0.4907302013889e+01,
5629           0.6572352589782e-08, 0.4901966774419e+01, 0.1176433076753e+02,
5630           0.5960236060795e-08, 0.1874672315797e+01, 0.1422690933580e-01,
5631           0.5125480043511e-08, 0.3735726064334e+01, 0.1245594543367e+02,
5632           0.5928241866410e-08, 0.4502033899935e+01, 0.6414617803568e+01,
5633           0.5249600357424e-08, 0.4372334799878e+01, 0.1151388321134e+02,
5634 
5635           0.6059171276087e-08, 0.2581617302908e+01, 0.6062663316000e+01,
5636           0.5295235081662e-08, 0.2974811513158e+01, 0.3496032717521e+01,
5637           0.5820561875933e-08, 0.1796073748244e+00, 0.2838593341516e+00,
5638           0.4754696606440e-08, 0.1981998136973e+01, 0.3104930017775e+01,
5639           0.6385053548955e-08, 0.2559174171605e+00, 0.6133512519065e+01,
5640           0.6589828273941e-08, 0.2750967106776e+01, 0.4087944051283e+02,
5641           0.5383376567189e-08, 0.6325947523578e+00, 0.2248384854122e+02,
5642           0.5928941683538e-08, 0.1672304519067e+01, 0.1581959461667e+01,
5643           0.4816060709794e-08, 0.3512566172575e+01, 0.9388005868221e+01,
5644           0.6003381586512e-08, 0.5610932219189e+01, 0.5326786718777e+01,
5645 
5646           0.5504225393105e-08, 0.4037501131256e+01, 0.6503488384892e+01,
5647           0.5353772620129e-08, 0.6122774968240e+01, 0.1735668374386e+03,
5648           0.5786253768544e-08, 0.5527984999515e+01, 0.1350651127443e+00,
5649           0.5065706702002e-08, 0.9980765573624e+00, 0.1248988586463e+02,
5650           0.5972838885276e-08, 0.6044489493203e+01, 0.2673594526851e+02,
5651           0.5323585877961e-08, 0.3924265998147e+01, 0.4171425416666e+01,
5652           0.5210772682858e-08, 0.6220111376901e+01, 0.2460261242967e+02,
5653           0.4726549040535e-08, 0.3716043206862e+01, 0.7232251527446e+01,
5654           0.6029425105059e-08, 0.8548704071116e+00, 0.3227113045244e+03,
5655           0.4481542826513e-08, 0.1426925072829e+01, 0.5547199253223e+01,
5656 
5657           0.5836024505068e-08, 0.7135651752625e-01, 0.7285056171570e+02,
5658           0.4137046613272e-08, 0.5330767643283e+01, 0.1087398597200e+02,
5659           0.5171977473924e-08, 0.4494262335353e+00, 0.1884570439172e+02,
5660           0.5694429833732e-08, 0.2952369582215e+01, 0.9723862754494e+02,
5661           0.4009158925298e-08, 0.3500003416535e+01, 0.6244942932314e+01,
5662           0.4784939596873e-08, 0.6196709413181e+01, 0.2929661536378e+02,
5663           0.3983725022610e-08, 0.5103690031897e+01, 0.4274518229222e+01,
5664           0.3870535232462e-08, 0.3187569587401e+01, 0.6321208768577e+01,
5665           0.5140501213951e-08, 0.1668924357457e+01, 0.1232032006293e+02,
5666           0.3849034819355e-08, 0.4445722510309e+01, 0.1726726808967e+02,
5667 
5668           0.4002383075060e-08, 0.5226224152423e+01, 0.7018952447668e+01,
5669           0.3890719543549e-08, 0.4371166550274e+01, 0.1491901785440e+02,
5670           0.4887084607881e-08, 0.5973556689693e+01, 0.1478866649112e+01,
5671           0.3739939287592e-08, 0.2089084714600e+01, 0.6922973089781e+01,
5672           0.5031925918209e-08, 0.4658371936827e+01, 0.1715706182245e+02,
5673           0.4387748764954e-08, 0.4825580552819e+01, 0.2331413144044e+03,
5674           0.4147398098865e-08, 0.3739003524998e+01, 0.1376059875786e+02,
5675           0.3719089993586e-08, 0.1148941386536e+01, 0.6297302759782e+01,
5676           0.3934238461056e-08, 0.1559893008343e+01, 0.7872148766781e+01,
5677           0.3672471375622e-08, 0.5516145383612e+01, 0.6268848941110e+01,
5678 
5679           0.3768911277583e-08, 0.6116053700563e+01, 0.4157198507331e+01,
5680           0.4033388417295e-08, 0.5076821746017e+01, 0.1567108171867e+02,
5681           0.3764194617832e-08, 0.8164676232075e+00, 0.3185192151914e+01,
5682           0.4840628226284e-08, 0.1360479453671e+01, 0.1252801878276e+02,
5683           0.4949443923785e-08, 0.2725622229926e+01, 0.1617106187867e+03,
5684           0.4117393089971e-08, 0.6054459628492e+00, 0.5642198095270e+01,
5685           0.3925754020428e-08, 0.8570462135210e+00, 0.2139354194808e+02,
5686           0.3630551757923e-08, 0.3552067338279e+01, 0.6294805223347e+01,
5687           0.3627274802357e-08, 0.3096565085313e+01, 0.6271346477544e+01,
5688           0.3806143885093e-08, 0.6367751709777e+00, 0.1725304118033e+02,
5689 
5690           0.4433254641565e-08, 0.4848461503937e+01, 0.7445550607224e+01,
5691           0.3712319846576e-08, 0.1331950643655e+01, 0.4194847048887e+00,
5692           0.3849847534783e-08, 0.4958368297746e+00, 0.9562891316684e+00,
5693           0.3483955430165e-08, 0.2237215515707e+01, 0.1161697602389e+02,
5694           0.3961912730982e-08, 0.3332402188575e+01, 0.2277943724828e+02,
5695           0.3419978244481e-08, 0.5785600576016e+01, 0.1362553364512e+02,
5696           0.3329417758177e-08, 0.9812676559709e-01, 0.1685848245639e+02,
5697           0.4207206893193e-08, 0.9494780468236e+00, 0.2986433403208e+02,
5698           0.3268548976410e-08, 0.1739332095686e+00, 0.5749861718712e+01,
5699           0.3321880082685e-08, 0.1423354800666e+01, 0.6279143387820e+01,
5700 
5701           0.4503173010852e-08, 0.2314972675293e+00, 0.1385561574497e+01,
5702           0.4316599090954e-08, 0.1012646782616e+00, 0.4176041334900e+01,
5703           0.3283493323850e-08, 0.5233306881265e+01, 0.6287008313071e+01,
5704           0.3164033542343e-08, 0.4005597257511e+01, 0.2099539292909e+02,
5705           0.4159720956725e-08, 0.5365676242020e+01, 0.5905702259363e+01,
5706           0.3565176892217e-08, 0.4284440620612e+01, 0.3932462625300e-02,
5707           0.3514440950221e-08, 0.4270562636575e+01, 0.7335344340001e+01,
5708           0.3540596871909e-08, 0.5953553201060e+01, 0.1234573916645e+02,
5709           0.2960769905118e-08, 0.1115180417718e+01, 0.2670964694522e+02,
5710           0.2962213739684e-08, 0.3863811918186e+01, 0.6408777551755e+00,
5711 
5712           0.3883556700251e-08, 0.1268617928302e+01, 0.6660449441528e+01,
5713           0.2919225516346e-08, 0.4908605223265e+01, 0.1375773836557e+01,
5714           0.3115158863370e-08, 0.3744519976885e+01, 0.3802769619140e-01,
5715           0.4099438144212e-08, 0.4173244670532e+01, 0.4480965020977e+02,
5716           0.2899531858964e-08, 0.5910601428850e+01, 0.2059724391010e+02,
5717           0.3289733429855e-08, 0.2488050078239e+01, 0.1081813534213e+02,
5718           0.3933075612875e-08, 0.1122363652883e+01, 0.3773735910827e+00,
5719           0.3021403764467e-08, 0.4951973724904e+01, 0.2982630633589e+02,
5720           0.2798598949757e-08, 0.5117057845513e+01, 0.1937891852345e+02,
5721           0.3397421302707e-08, 0.6104159180476e+01, 0.6923953605621e+01,
5722 
5723           0.3720398002179e-08, 0.1184933429829e+01, 0.3066615496545e+02,
5724           0.3598484186267e-08, 0.3505282086105e+01, 0.6147450479709e+01,
5725           0.3694594027310e-08, 0.2286651088141e+01, 0.2636725487657e+01,
5726           0.2680444152969e-08, 0.1871816775482e+00, 0.6816289982179e+01,
5727           0.3497574865641e-08, 0.3143251755431e+01, 0.6418701221183e+01,
5728           0.3130274129494e-08, 0.2462167316018e+01, 0.1235996607578e+02,
5729           0.3241119069551e-08, 0.4256374004686e+01, 0.1652265972112e+02,
5730           0.2601960842061e-08, 0.4970362941425e+01, 0.1045450126711e+02,
5731           0.2690601527504e-08, 0.2372657824898e+01, 0.3163918923335e+00,
5732           0.2908688152664e-08, 0.4232652627721e+01, 0.2828699048865e+02,
5733 
5734           0.3120456131875e-08, 0.3925747001137e+00, 0.2195415756911e+02,
5735           0.3148855423384e-08, 0.3093478330445e+01, 0.1172006883645e+02,
5736           0.3051044261017e-08, 0.5560948248212e+01, 0.6055599646783e+01,
5737           0.2826006876660e-08, 0.5072790310072e+01, 0.5120601093667e+01,
5738           0.3100034191711e-08, 0.4998530231096e+01, 0.1799603123222e+02,
5739           0.2398771640101e-08, 0.2561739802176e+01, 0.6255674361143e+01,
5740           0.2384002842728e-08, 0.4087420284111e+01, 0.6310477339748e+01,
5741           0.2842146517568e-08, 0.2515048217955e+01, 0.5469525544182e+01,
5742           0.2847674371340e-08, 0.5235326497443e+01, 0.1034429499989e+02,
5743           0.2903722140764e-08, 0.1088200795797e+01, 0.6510552054109e+01,
5744 
5745           0.3187610710605e-08, 0.4710624424816e+01, 0.1693792562116e+03,
5746           0.3048869992813e-08, 0.2857975896445e+00, 0.8390110365991e+01,
5747           0.2860216950984e-08, 0.2241619020815e+01, 0.2243449970715e+00,
5748           0.2701117683113e-08, 0.6651573305272e-01, 0.6129297044991e+01,
5749           0.2509891590152e-08, 0.1285135324585e+01, 0.1044027435778e+02,
5750           0.2623200252223e-08, 0.2981229834530e+00, 0.6436854655901e+01,
5751           0.2622541669202e-08, 0.6122470726189e+01, 0.9380959548977e+01,
5752           0.2818435667099e-08, 0.4251087148947e+01, 0.5934151399930e+01,
5753           0.2365196797465e-08, 0.3465070460790e+01, 0.2470570524223e+02,
5754           0.2358704646143e-08, 0.5791603815350e+01, 0.8671969964381e+01,
5755 
5756           0.2388299481390e-08, 0.4142483772941e+01, 0.7096626156709e+01,
5757           0.1996041217224e-08, 0.2101901889496e+01, 0.1727188400790e+02,
5758           0.2687593060336e-08, 0.1526689456959e+01, 0.7075506709219e+02,
5759           0.2618913670810e-08, 0.2397684236095e+01, 0.6632000300961e+01,
5760           0.2571523050364e-08, 0.5751929456787e+00, 0.6206810014183e+01,
5761           0.2582135006946e-08, 0.5595464352926e+01, 0.4873985990671e+02,
5762           0.2372530190361e-08, 0.5092689490655e+01, 0.1590676413561e+02,
5763           0.2357178484712e-08, 0.4444363527851e+01, 0.3097883698531e+01,
5764           0.2451590394723e-08, 0.3108251687661e+01, 0.6612329252343e+00,
5765           0.2370045949608e-08, 0.2608133861079e+01, 0.3459636466239e+02,
5766 
5767           0.2268997267358e-08, 0.3639717753384e+01, 0.2844914056730e-01,
5768           0.1731432137906e-08, 0.1741898445707e+00, 0.2019909489111e+02,
5769           0.1629869741622e-08, 0.3902225646724e+01, 0.3035599730800e+02,
5770           0.2206215801974e-08, 0.4971131250731e+01, 0.6281667977667e+01,
5771           0.2205469554680e-08, 0.1677462357110e+01, 0.6284483723224e+01,
5772           0.2148792362509e-08, 0.4236259604006e+01, 0.1980482729015e+02,
5773           0.1873733657847e-08, 0.5926814998687e+01, 0.2876692439167e+02,
5774           0.2026573758959e-08, 0.4349643351962e+01, 0.2449240616245e+02,
5775           0.1807770325110e-08, 0.5700940482701e+01, 0.2045286941806e+02,
5776           0.1881174408581e-08, 0.6601286363430e+00, 0.2358125818164e+02,
5777 
5778           0.1368023671690e-08, 0.2211098592752e+01, 0.2473415438279e+02,
5779           0.1720017916280e-08, 0.4942488551129e+01, 0.1679593901136e+03,
5780           0.1702427665131e-08, 0.1452233856386e+01, 0.3338575901272e+03,
5781           0.1414032510054e-08, 0.5525357721439e+01, 0.1624205518357e+03,
5782           0.1652626045364e-08, 0.4108794283624e+01, 0.8956999012000e+02,
5783           0.1642957769686e-08, 0.7344335209984e+00, 0.5267006960365e+02,
5784           0.1614952403624e-08, 0.3541213951363e+01, 0.3332657872986e+02,
5785           0.1535988291188e-08, 0.4031094072151e+01, 0.3852657435933e+02,
5786           0.1593193738177e-08, 0.4185136203609e+01, 0.2282781046519e+03,
5787           0.1074569126382e-08, 0.1720485636868e+01, 0.8397383534231e+02,
5788 
5789           0.1074408214509e-08, 0.2758613420318e+01, 0.8401985929482e+02,
5790           0.9700199670465e-09, 0.4216686842097e+01, 0.7826370942180e+02,
5791           0.1258433517061e-08, 0.2575068876639e+00, 0.3115650189215e+03,
5792           0.1240303229539e-08, 0.4800844956756e+00, 0.1784300471910e+03,
5793           0.9018345948127e-09, 0.3896756361552e+00, 0.5886454391678e+02,
5794           0.1135301432805e-08, 0.3700805023550e+00, 0.7842370451713e+02,
5795           0.9215887951370e-09, 0.4364579276638e+01, 0.1014262087719e+03,
5796           0.1055401054147e-08, 0.2156564222111e+01, 0.5660027930059e+02,
5797           0.1008725979831e-08, 0.5454015785234e+01, 0.4245678405627e+02,
5798           0.7217398104321e-09, 0.1597772562175e+01, 0.2457074661053e+03,
5799 
5800           0.6912033134447e-09, 0.5824090621461e+01, 0.1679936946371e+03,
5801           0.6833881523549e-09, 0.3578778482835e+01, 0.6053048899753e+02,
5802           0.4887304205142e-09, 0.3724362812423e+01, 0.9656299901946e+02,
5803           0.5173709754788e-09, 0.5422427507933e+01, 0.2442876000072e+03,
5804           0.4671353097145e-09, 0.2396106924439e+01, 0.1435713242844e+03,
5805           0.5652608439480e-09, 0.2804028838685e+01, 0.8365903305582e+02,
5806           0.5604061331253e-09, 0.1638816006247e+01, 0.8433466158131e+02,
5807           0.4712723365400e-09, 0.8979003224474e+00, 0.3164282286739e+03,
5808           0.4909967465112e-09, 0.3210426725516e+01, 0.4059982187939e+03,
5809           0.4771358267658e-09, 0.5308027211629e+01, 0.1805255418145e+03,
5810 
5811           0.3943451445989e-09, 0.2195145341074e+01, 0.2568537517081e+03,
5812           0.3952109120244e-09, 0.5081189491586e+01, 0.2449975330562e+03,
5813           0.3788134594789e-09, 0.4345171264441e+01, 0.1568131045107e+03,
5814           0.3738330190479e-09, 0.2613062847997e+01, 0.3948519331910e+03,
5815           0.3099866678136e-09, 0.2846760817689e+01, 0.1547176098872e+03,
5816           0.2002962716768e-09, 0.4921360989412e+01, 0.2268582385539e+03,
5817           0.2198291338754e-09, 0.1130360117454e+00, 0.1658638954901e+03,
5818           0.1491958330784e-09, 0.4228195232278e+01, 0.2219950288015e+03,
5819           0.1475384076173e-09, 0.3005721811604e+00, 0.3052819430710e+03,
5820           0.1661626624624e-09, 0.7830125621203e+00, 0.2526661704812e+03,
5821 
5822           0.9015823460025e-10, 0.3807792942715e+01, 0.4171445043968e+03 };
5823 
5824     /* Sun-to-Earth, T^0, Y */
5825       static final double e0y[] = {
5826           0.9998921098898e+00, 0.1826583913846e+00, 0.6283075850446e+01,
5827          -0.2442700893735e-01, 0.0000000000000e+00, 0.0000000000000e+00,
5828           0.8352929742915e-02, 0.1395277998680e+00, 0.1256615170089e+02,
5829           0.1046697300177e-03, 0.9641423109763e-01, 0.1884922755134e+02,
5830           0.3110841876663e-04, 0.5381140401712e+01, 0.8399684731857e+02,
5831           0.2570269094593e-04, 0.5301016407128e+01, 0.5296909721118e+00,
5832           0.2147389623610e-04, 0.2662510869850e+01, 0.1577343543434e+01,
5833           0.1680344384050e-04, 0.5207904119704e+01, 0.6279552690824e+01,
5834           0.1679117312193e-04, 0.4582187486968e+01, 0.6286599010068e+01,
5835           0.1440512068440e-04, 0.1900688517726e+01, 0.2352866153506e+01,
5836 
5837           0.1135139664999e-04, 0.5273108538556e+01, 0.5223693906222e+01,
5838           0.9345482571018e-05, 0.4503047687738e+01, 0.1203646072878e+02,
5839           0.9007418719568e-05, 0.1605621059637e+01, 0.1021328554739e+02,
5840           0.5671536712314e-05, 0.5812849070861e+00, 0.1059381944224e+01,
5841           0.7451401861666e-05, 0.2807346794836e+01, 0.3981490189893e+00,
5842           0.6393470057114e-05, 0.6029224133855e+01, 0.5753384878334e+01,
5843           0.6814275881697e-05, 0.6472990145974e+00, 0.4705732307012e+01,
5844           0.6113705628887e-05, 0.3813843419700e+01, 0.6812766822558e+01,
5845           0.4503851367273e-05, 0.4527804370996e+01, 0.5884926831456e+01,
5846           0.4522249141926e-05, 0.5991783029224e+01, 0.6256777527156e+01,
5847 
5848           0.4501794307018e-05, 0.3798703844397e+01, 0.6309374173736e+01,
5849           0.5514927480180e-05, 0.3961257833388e+01, 0.5507553240374e+01,
5850           0.4062862799995e-05, 0.5256247296369e+01, 0.6681224869435e+01,
5851           0.5414900429712e-05, 0.5499032014097e+01, 0.7755226100720e+00,
5852           0.5463153987424e-05, 0.6173092454097e+01, 0.1414349524433e+02,
5853           0.5071611859329e-05, 0.2870244247651e+01, 0.7860419393880e+01,
5854           0.2195112094455e-05, 0.2952338617201e+01, 0.1150676975667e+02,
5855           0.2279139233919e-05, 0.5951775132933e+01, 0.7058598460518e+01,
5856           0.2278386100876e-05, 0.4845456398785e+01, 0.4694002934110e+01,
5857           0.2559088003308e-05, 0.6945321117311e+00, 0.1216800268190e+02,
5858 
5859           0.2561079286856e-05, 0.6167224608301e+01, 0.7099330490126e+00,
5860           0.1792755796387e-05, 0.1400122509632e+01, 0.7962980379786e+00,
5861           0.1818715656502e-05, 0.4703347611830e+01, 0.6283142985870e+01,
5862           0.1818744924791e-05, 0.5086748900237e+01, 0.6283008715021e+01,
5863           0.1554518791390e-05, 0.5331008042713e-01, 0.2513230340178e+02,
5864           0.2063265737239e-05, 0.4283680484178e+01, 0.1179062909082e+02,
5865           0.1497613520041e-05, 0.6074207826073e+01, 0.5486777812467e+01,
5866           0.2000617940427e-05, 0.2501426281450e+01, 0.1778984560711e+02,
5867           0.1289731195580e-05, 0.3646340599536e+01, 0.7079373888424e+01,
5868           0.1282657998934e-05, 0.3232864804902e+01, 0.3738761453707e+01,
5869 
5870           0.1528915968658e-05, 0.5581433416669e+01, 0.2132990797783e+00,
5871           0.1187304098432e-05, 0.5453576453694e+01, 0.9437762937313e+01,
5872           0.7842782928118e-06, 0.2823953922273e+00, 0.8827390247185e+01,
5873           0.7352892280868e-06, 0.1124369580175e+01, 0.1589072916335e+01,
5874           0.6570189360797e-06, 0.2089154042840e+01, 0.1176985366291e+02,
5875           0.6324967590410e-06, 0.6704855581230e+00, 0.6262300422539e+01,
5876           0.6298289872283e-06, 0.2836414855840e+01, 0.6303851278352e+01,
5877           0.6476686465855e-06, 0.4852433866467e+00, 0.7113454667900e-02,
5878           0.8587034651234e-06, 0.1453511005668e+01, 0.1672837615881e+03,
5879           0.8068948788113e-06, 0.9224087798609e+00, 0.6069776770667e+01,
5880 
5881           0.8353786011661e-06, 0.4631707184895e+01, 0.3340612434717e+01,
5882           0.6009324532132e-06, 0.1829498827726e+01, 0.4136910472696e+01,
5883           0.7558158559566e-06, 0.2588596800317e+01, 0.6496374930224e+01,
5884           0.5809279504503e-06, 0.5516818853476e+00, 0.1097707878456e+02,
5885           0.5374131950254e-06, 0.6275674734960e+01, 0.1194447056968e+01,
5886           0.5711160507326e-06, 0.1091905956872e+01, 0.6282095334605e+01,
5887           0.5710183170746e-06, 0.2415001635090e+01, 0.6284056366286e+01,
5888           0.5144373590610e-06, 0.6020336443438e+01, 0.6290189305114e+01,
5889           0.5103108927267e-06, 0.3775634564605e+01, 0.6275962395778e+01,
5890           0.4960654697891e-06, 0.1073450946756e+01, 0.6127655567643e+01,
5891 
5892           0.4786385689280e-06, 0.2431178012310e+01, 0.6438496133249e+01,
5893           0.6109911263665e-06, 0.5343356157914e+01, 0.3154687086868e+01,
5894           0.4839898944024e-06, 0.5830833594047e-01, 0.8018209333619e+00,
5895           0.4734822623919e-06, 0.4536080134821e+01, 0.3128388763578e+01,
5896           0.4834741473290e-06, 0.2585090489754e+00, 0.7084896783808e+01,
5897           0.5134858581156e-06, 0.4213317172603e+01, 0.1235285262111e+02,
5898           0.5064004264978e-06, 0.4814418806478e+00, 0.1185621865188e+02,
5899           0.3753476772761e-06, 0.1599953399788e+01, 0.8429241228195e+01,
5900           0.4935264014283e-06, 0.2157417556873e+01, 0.2544314396739e+01,
5901           0.3950929600897e-06, 0.3359394184254e+01, 0.5481254917084e+01,
5902 
5903           0.4895849789777e-06, 0.5165704376558e+01, 0.9225539266174e+01,
5904           0.4215241688886e-06, 0.2065368800993e+01, 0.1726015463500e+02,
5905           0.3796773731132e-06, 0.1468606346612e+01, 0.4265981595566e+00,
5906           0.3114178142515e-06, 0.3615638079474e+01, 0.2146165377750e+01,
5907           0.3260664220838e-06, 0.4417134922435e+01, 0.4164311961999e+01,
5908           0.3976996123008e-06, 0.4700866883004e+01, 0.5856477690889e+01,
5909           0.2801459672924e-06, 0.4538902060922e+01, 0.1256967486051e+02,
5910           0.3638931868861e-06, 0.1334197991475e+01, 0.1807370494127e+02,
5911           0.2487013269476e-06, 0.3749275558275e+01, 0.2629832328990e-01,
5912           0.3034165481994e-06, 0.4236622030873e+00, 0.4535059491685e+01,
5913 
5914           0.2676278825586e-06, 0.5970848007811e+01, 0.3930209696940e+01,
5915           0.2764903818918e-06, 0.5194636754501e+01, 0.1256262854127e+02,
5916           0.2485149930507e-06, 0.1002434207846e+01, 0.5088628793478e+01,
5917           0.2199305540941e-06, 0.3066773098403e+01, 0.1255903824622e+02,
5918           0.2571106500435e-06, 0.7588312459063e+00, 0.1336797263425e+02,
5919           0.2049751817158e-06, 0.3444977434856e+01, 0.1137170464392e+02,
5920           0.2599707296297e-06, 0.1873128542205e+01, 0.7143069561767e+02,
5921           0.1785018072217e-06, 0.5015891306615e+01, 0.1748016358760e+01,
5922           0.2324833891115e-06, 0.4618271239730e+01, 0.1831953657923e+02,
5923           0.1709711119545e-06, 0.5300003455669e+01, 0.4933208510675e+01,
5924 
5925           0.2107159351716e-06, 0.2229819815115e+01, 0.7477522907414e+01,
5926           0.1750333080295e-06, 0.6161485880008e+01, 0.1044738781244e+02,
5927           0.2000598210339e-06, 0.2967357299999e+01, 0.8031092209206e+01,
5928           0.1380920248681e-06, 0.3027007923917e+01, 0.8635942003952e+01,
5929           0.1412460470299e-06, 0.6037597163798e+01, 0.2942463415728e+01,
5930           0.1888459803001e-06, 0.8561476243374e+00, 0.1561374759853e+03,
5931           0.1788370542585e-06, 0.4869736290209e+01, 0.1592596075957e+01,
5932           0.1360893296167e-06, 0.3626411886436e+01, 0.1309584267300e+02,
5933           0.1506846530160e-06, 0.1550975377427e+01, 0.1649636139783e+02,
5934           0.1800913376176e-06, 0.2075826033190e+01, 0.1729818233119e+02,
5935 
5936           0.1436261390649e-06, 0.6148876420255e+01, 0.2042657109477e+02,
5937           0.1220227114151e-06, 0.4382583879906e+01, 0.7632943190217e+01,
5938           0.1337883603592e-06, 0.2036644327361e+01, 0.1213955354133e+02,
5939           0.1159326650738e-06, 0.3892276994687e+01, 0.5331357529664e+01,
5940           0.1352853128569e-06, 0.1447950649744e+01, 0.1673046366289e+02,
5941           0.1433408296083e-06, 0.4457854692961e+01, 0.7342457794669e+01,
5942           0.1234701666518e-06, 0.1538818147151e+01, 0.6279485555400e+01,
5943           0.1234027192007e-06, 0.1968523220760e+01, 0.6286666145492e+01,
5944           0.1244024091797e-06, 0.5779803499985e+01, 0.1511046609763e+02,
5945           0.1097934945516e-06, 0.6210975221388e+00, 0.1098880815746e+02,
5946 
5947           0.1254611329856e-06, 0.2591963807998e+01, 0.1572083878776e+02,
5948           0.1158247286784e-06, 0.2483612812670e+01, 0.5729506548653e+01,
5949           0.9039078252960e-07, 0.3857554579796e+01, 0.9623688285163e+01,
5950           0.9108024978836e-07, 0.5826368512984e+01, 0.7234794171227e+01,
5951           0.8887068108436e-07, 0.3475694573987e+01, 0.6148010737701e+01,
5952           0.8632374035438e-07, 0.3059070488983e-01, 0.6418140963190e+01,
5953           0.7893186992967e-07, 0.1583194837728e+01, 0.2118763888447e+01,
5954           0.8297650201172e-07, 0.8519770534637e+00, 0.1471231707864e+02,
5955           0.1019759578988e-06, 0.1319598738732e+00, 0.1349867339771e+01,
5956           0.1010037696236e-06, 0.9937860115618e+00, 0.6836645152238e+01,
5957 
5958           0.1047727548266e-06, 0.1382138405399e+01, 0.5999216516294e+01,
5959           0.7351993881086e-07, 0.3833397851735e+01, 0.6040347114260e+01,
5960           0.9868771092341e-07, 0.2124913814390e+01, 0.6566935184597e+01,
5961           0.7007321959390e-07, 0.5946305343763e+01, 0.6525804586632e+01,
5962           0.6861411679709e-07, 0.4574654977089e+01, 0.7238675589263e+01,
5963           0.7554519809614e-07, 0.5949232686844e+01, 0.1253985337760e+02,
5964           0.9541880448335e-07, 0.3495242990564e+01, 0.2122839202813e+02,
5965           0.7185606722155e-07, 0.4310113471661e+01, 0.6245048154254e+01,
5966           0.7131360871710e-07, 0.5480309323650e+01, 0.6321103546637e+01,
5967           0.6651142021039e-07, 0.5411097713654e+01, 0.5327476111629e+01,
5968 
5969           0.8538618213667e-07, 0.1827849973951e+01, 0.1101510648075e+02,
5970           0.8634954288044e-07, 0.5443584943349e+01, 0.5643178611111e+01,
5971           0.7449415051484e-07, 0.2011535459060e+01, 0.5368044267797e+00,
5972           0.7421047599169e-07, 0.3464562529249e+01, 0.2354323048545e+02,
5973           0.6140694354424e-07, 0.5657556228815e+01, 0.1296430071988e+02,
5974           0.6353525143033e-07, 0.3463816593821e+01, 0.1990745094947e+01,
5975           0.6221964013447e-07, 0.1532259498697e+01, 0.9517183207817e+00,
5976           0.5852480257244e-07, 0.1375396598875e+01, 0.9555997388169e+00,
5977           0.6398637498911e-07, 0.2405645801972e+01, 0.2407292145756e+02,
5978           0.7039744069878e-07, 0.5397541799027e+01, 0.5225775174439e+00,
5979 
5980           0.6977997694382e-07, 0.4762347105419e+01, 0.1097355562493e+02,
5981           0.7460629558396e-07, 0.2711944692164e+01, 0.2200391463820e+02,
5982           0.5376577536101e-07, 0.2352980430239e+01, 0.1431416805965e+02,
5983           0.7530607893556e-07, 0.1943940180699e+01, 0.1842262939178e+02,
5984           0.6822928971605e-07, 0.4337651846959e+01, 0.1554202828031e+00,
5985           0.6220772380094e-07, 0.6716871369278e+00, 0.1845107853235e+02,
5986           0.6586950799043e-07, 0.2229714460505e+01, 0.5216580451554e+01,
5987           0.5873800565771e-07, 0.7627013920580e+00, 0.6398972393349e+00,
5988           0.6264346929745e-07, 0.6202785478961e+00, 0.6277552955062e+01,
5989           0.6257929115669e-07, 0.2886775596668e+01, 0.6288598745829e+01,
5990 
5991           0.5343536033409e-07, 0.1977241012051e+01, 0.4690479774488e+01,
5992           0.5587849781714e-07, 0.1922923484825e+01, 0.1551045220144e+01,
5993           0.6905100845603e-07, 0.3570757164631e+01, 0.1030928125552e+00,
5994           0.6178957066649e-07, 0.5197558947765e+01, 0.5230807360890e+01,
5995           0.6187270224331e-07, 0.8193497368922e+00, 0.5650292065779e+01,
5996           0.5385664291426e-07, 0.5406336665586e+01, 0.7771377146812e+02,
5997           0.6329363917926e-07, 0.2837760654536e+01, 0.2608790314060e+02,
5998           0.4546018761604e-07, 0.2933580297050e+01, 0.5535693017924e+00,
5999           0.6196091049375e-07, 0.4157871494377e+01, 0.8467247584405e+02,
6000           0.6159555108218e-07, 0.3211703561703e+01, 0.2394243902548e+03,
6001 
6002           0.4995340539317e-07, 0.1459098102922e+01, 0.4732030630302e+01,
6003           0.5457031243572e-07, 0.1430457676136e+01, 0.6179983037890e+01,
6004           0.4863461418397e-07, 0.2196425916730e+01, 0.9027992316901e+02,
6005           0.5342947626870e-07, 0.2086612890268e+01, 0.6386168663001e+01,
6006           0.5674296648439e-07, 0.2760204966535e+01, 0.6915859635113e+01,
6007           0.4745783120161e-07, 0.4245368971862e+01, 0.6282970628506e+01,
6008           0.4745676961198e-07, 0.5544725787016e+01, 0.6283181072386e+01,
6009           0.4049796869973e-07, 0.2213984363586e+01, 0.6254626709878e+01,
6010           0.4248333596940e-07, 0.8075781952896e+00, 0.7875671926403e+01,
6011           0.4027178070205e-07, 0.1293268540378e+01, 0.6311524991013e+01,
6012 
6013           0.4066543943476e-07, 0.3986141175804e+01, 0.3634620989887e+01,
6014           0.4858863787880e-07, 0.1276112738231e+01, 0.5760498333002e+01,
6015           0.5277398263530e-07, 0.4916111741527e+01, 0.2515860172507e+02,
6016           0.4105635656559e-07, 0.1725805864426e+01, 0.6709674010002e+01,
6017           0.4376781925772e-07, 0.2243642442106e+01, 0.6805653367890e+01,
6018           0.3235827894693e-07, 0.3614135118271e+01, 0.1066495398892e+01,
6019           0.3073244740308e-07, 0.2460873393460e+01, 0.5863591145557e+01,
6020           0.3088609271373e-07, 0.5678431771790e+01, 0.9917696840332e+01,
6021           0.3393022279836e-07, 0.3814017477291e+01, 0.1391601904066e+02,
6022           0.3038686508802e-07, 0.4660216229171e+01, 0.1256621883632e+02,
6023 
6024           0.4019677752497e-07, 0.5906906243735e+01, 0.1334167431096e+02,
6025           0.3288834998232e-07, 0.9536146445882e+00, 0.1620077269078e+02,
6026           0.3889973794631e-07, 0.3942205097644e+01, 0.7478166569050e-01,
6027           0.3050438987141e-07, 0.1624810271286e+01, 0.1805292951336e+02,
6028           0.3601142564638e-07, 0.4030467142575e+01, 0.6208294184755e+01,
6029           0.3689015557141e-07, 0.3648878818694e+01, 0.5966683958112e+01,
6030           0.3563471893565e-07, 0.5749584017096e+01, 0.6357857516136e+01,
6031           0.2776183170667e-07, 0.2630124187070e+01, 0.3523159621801e-02,
6032           0.2922350530341e-07, 0.1790346403629e+01, 0.1272157198369e+02,
6033           0.3511076917302e-07, 0.6142198301611e+01, 0.6599467742779e+01,
6034 
6035           0.3619351007632e-07, 0.1432421386492e+01, 0.6019991944201e+01,
6036           0.2561254711098e-07, 0.2302822475792e+01, 0.1259245002418e+02,
6037           0.2626903942920e-07, 0.8660470994571e+00, 0.6702560555334e+01,
6038           0.2550187397083e-07, 0.6069721995383e+01, 0.1057540660594e+02,
6039           0.2535873526138e-07, 0.1079020331795e-01, 0.3141537925223e+02,
6040           0.3519786153847e-07, 0.3809066902283e+01, 0.2505706758577e+03,
6041           0.3424651492873e-07, 0.2075435114417e+01, 0.6546159756691e+01,
6042           0.2372676630861e-07, 0.2057803120154e+01, 0.2388894113936e+01,
6043           0.2710980779541e-07, 0.1510068488010e+01, 0.1202934727411e+02,
6044           0.3038710889704e-07, 0.5043617528901e+01, 0.1256608456547e+02,
6045 
6046           0.2220364130585e-07, 0.3694793218205e+01, 0.1336244973887e+02,
6047           0.3025880825460e-07, 0.5450618999049e-01, 0.2908881142201e+02,
6048           0.2784493486864e-07, 0.3381164084502e+01, 0.1494531617769e+02,
6049           0.2294414142438e-07, 0.4382309025210e+01, 0.6076890225335e+01,
6050           0.2012723294724e-07, 0.9142212256518e+00, 0.6262720680387e+01,
6051           0.2036357831958e-07, 0.5676172293154e+01, 0.4701116388778e+01,
6052           0.2003474823288e-07, 0.2592767977625e+01, 0.6303431020504e+01,
6053           0.2207144900109e-07, 0.5404976271180e+01, 0.6489261475556e+01,
6054           0.2481664905135e-07, 0.4373284587027e+01, 0.1204357418345e+02,
6055           0.2674949182295e-07, 0.5859182188482e+01, 0.4590910121555e+01,
6056 
6057           0.2450554720322e-07, 0.4555381557451e+01, 0.1495633313810e+00,
6058           0.2601975986457e-07, 0.3933165584959e+01, 0.1965104848470e+02,
6059           0.2199860022848e-07, 0.5227977189087e+01, 0.1351787002167e+02,
6060           0.2448121172316e-07, 0.4858060353949e+01, 0.1162474756779e+01,
6061           0.1876014864049e-07, 0.5690546553605e+01, 0.6279194432410e+01,
6062           0.1874513219396e-07, 0.4099539297446e+01, 0.6286957268481e+01,
6063           0.2156380842559e-07, 0.4382594769913e+00, 0.1813929450232e+02,
6064           0.1981691240061e-07, 0.1829784152444e+01, 0.4686889479442e+01,
6065           0.2329992648539e-07, 0.2836254278973e+01, 0.1002183730415e+02,
6066           0.1765184135302e-07, 0.2803494925833e+01, 0.4292330755499e+01,
6067 
6068           0.2436368366085e-07, 0.2836897959677e+01, 0.9514313292143e+02,
6069           0.2164089203889e-07, 0.6127522446024e+01, 0.6037244212485e+01,
6070           0.1847755034221e-07, 0.3683163635008e+01, 0.2427287361862e+00,
6071           0.1674798769966e-07, 0.3316993867246e+00, 0.1311972100268e+02,
6072           0.2222542124356e-07, 0.8294097805480e+00, 0.1266924451345e+02,
6073           0.2071074505925e-07, 0.3659492220261e+01, 0.6528907488406e+01,
6074           0.1608224471835e-07, 0.4774492067182e+01, 0.1352175143971e+02,
6075           0.1857583439071e-07, 0.2873120597682e+01, 0.8662240327241e+01,
6076           0.1793018836159e-07, 0.5282441177929e+00, 0.6819880277225e+01,
6077           0.1575391221692e-07, 0.1320789654258e+01, 0.1102062672231e+00,
6078 
6079           0.1840132009557e-07, 0.1917110916256e+01, 0.6514761976723e+02,
6080           0.1760917288281e-07, 0.2972635937132e+01, 0.5746271423666e+01,
6081           0.1561779518516e-07, 0.4372569261981e+01, 0.6272439236156e+01,
6082           0.1558687885205e-07, 0.5416424926425e+01, 0.6293712464735e+01,
6083           0.1951359382579e-07, 0.3094448898752e+01, 0.2301353951334e+02,
6084           0.1569144275614e-07, 0.2802103689808e+01, 0.1765478049437e+02,
6085           0.1479130389462e-07, 0.2136435020467e+01, 0.2077542790660e-01,
6086           0.1467828510764e-07, 0.7072627435674e+00, 0.1052268489556e+01,
6087           0.1627627337440e-07, 0.3947607143237e+01, 0.6327837846670e+00,
6088           0.1503498479758e-07, 0.4079248909190e+01, 0.7626583626240e-01,
6089 
6090           0.1297967708237e-07, 0.6269637122840e+01, 0.1149965630200e+02,
6091           0.1374416896634e-07, 0.4175657970702e+01, 0.6016468784579e+01,
6092           0.1783812325219e-07, 0.1476540547560e+01, 0.3301902111895e+02,
6093           0.1525884228756e-07, 0.4653477715241e+01, 0.9411464614024e+01,
6094           0.1451067396763e-07, 0.2573001128225e+01, 0.1277945078067e+02,
6095           0.1297713111950e-07, 0.5612799618771e+01, 0.6549682916313e+01,
6096           0.1462784012820e-07, 0.4189661623870e+01, 0.1863592847156e+02,
6097           0.1384185980007e-07, 0.2656915472196e+01, 0.2379164476796e+01,
6098           0.1221497599801e-07, 0.5612515760138e+01, 0.1257326515556e+02,
6099           0.1560574525896e-07, 0.4783414317919e+01, 0.1887552587463e+02,
6100 
6101           0.1544598372036e-07, 0.2694431138063e+01, 0.1820933031200e+02,
6102           0.1531678928696e-07, 0.4105103489666e+01, 0.2593412433514e+02,
6103           0.1349321503795e-07, 0.3082437194015e+00, 0.5120601093667e+01,
6104           0.1252030290917e-07, 0.6124072334087e+01, 0.6993008899458e+01,
6105           0.1459243816687e-07, 0.3733103981697e+01, 0.3813291813120e-01,
6106           0.1226103625262e-07, 0.1267127706817e+01, 0.2435678079171e+02,
6107           0.1019449641504e-07, 0.4367790112269e+01, 0.1725663147538e+02,
6108           0.1380789433607e-07, 0.3387201768700e+01, 0.2458316379602e+00,
6109           0.1019453421658e-07, 0.9204143073737e+00, 0.6112403035119e+01,
6110           0.1297929434405e-07, 0.5786874896426e+01, 0.1249137003520e+02,
6111 
6112           0.9912677786097e-08, 0.3164232870746e+01, 0.6247047890016e+01,
6113           0.9829386098599e-08, 0.2586762413351e+01, 0.6453748665772e+01,
6114           0.1226807746104e-07, 0.6239068436607e+01, 0.5429879531333e+01,
6115           0.1192691755997e-07, 0.1867380051424e+01, 0.6290122169689e+01,
6116           0.9836499227081e-08, 0.3424716293727e+00, 0.6319103810876e+01,
6117           0.9642862564285e-08, 0.5661372990657e+01, 0.8273820945392e+01,
6118           0.1165184404862e-07, 0.5768367239093e+01, 0.1778273215245e+02,
6119           0.1175794418818e-07, 0.1657351222943e+01, 0.6276029531202e+01,
6120           0.1018948635601e-07, 0.6458292350865e+00, 0.1254537627298e+02,
6121           0.9500383606676e-08, 0.1054306140741e+01, 0.1256517118505e+02,
6122 
6123           0.1227512202906e-07, 0.2505278379114e+01, 0.2248384854122e+02,
6124           0.9664792009993e-08, 0.4289737277000e+01, 0.6259197520765e+01,
6125           0.9613285666331e-08, 0.5500597673141e+01, 0.6306954180126e+01,
6126           0.1117906736211e-07, 0.2361405953468e+01, 0.1779695906178e+02,
6127           0.9611378640782e-08, 0.2851310576269e+01, 0.2061856251104e+00,
6128           0.8845354852370e-08, 0.6208777705343e+01, 0.1692165728891e+01,
6129           0.1054046966600e-07, 0.5413091423934e+01, 0.2204125344462e+00,
6130           0.1215539124483e-07, 0.5613969479755e+01, 0.8257698122054e+02,
6131           0.9932460955209e-08, 0.1106124877015e+01, 0.1017725758696e+02,
6132           0.8785804715043e-08, 0.2869224476477e+01, 0.9491756770005e+00,
6133 
6134           0.8538084097562e-08, 0.6159640899344e+01, 0.6393282117669e+01,
6135           0.8648994369529e-08, 0.1374901198784e+01, 0.4804209201333e+01,
6136           0.1039063219067e-07, 0.5171080641327e+01, 0.1550861511662e+02,
6137           0.8867983926439e-08, 0.8317320304902e+00, 0.3903911373650e+01,
6138           0.8327495955244e-08, 0.3605591969180e+01, 0.6172869583223e+01,
6139           0.9243088356133e-08, 0.6114299196843e+01, 0.6267823317922e+01,
6140           0.9205657357835e-08, 0.3675153683737e+01, 0.6298328382969e+01,
6141           0.1033269714606e-07, 0.3313328813024e+01, 0.5573142801433e+01,
6142           0.8001706275552e-08, 0.2019980960053e+01, 0.2648454860559e+01,
6143           0.9171858254191e-08, 0.8992015524177e+00, 0.1498544001348e+03,
6144 
6145           0.1075327150242e-07, 0.2898669963648e+01, 0.3694923081589e+02,
6146           0.9884866689828e-08, 0.4946715904478e+01, 0.1140367694411e+02,
6147           0.9541835576677e-08, 0.2371787888469e+01, 0.1256713221673e+02,
6148           0.7739903376237e-08, 0.2213775190612e+01, 0.7834121070590e+01,
6149           0.7311962684106e-08, 0.3429378787739e+01, 0.1192625446156e+02,
6150           0.9724904869624e-08, 0.6195878564404e+01, 0.2280573557157e+02,
6151           0.9251628983612e-08, 0.6511509527390e+00, 0.2787043132925e+01,
6152           0.7320763787842e-08, 0.6001083639421e+01, 0.6282655592598e+01,
6153           0.7320296650962e-08, 0.3789073265087e+01, 0.6283496108294e+01,
6154           0.7947032271039e-08, 0.1059659582204e+01, 0.1241073141809e+02,
6155 
6156           0.9005277053115e-08, 0.1280315624361e+01, 0.6281591679874e+01,
6157           0.8995601652048e-08, 0.2224439106766e+01, 0.6284560021018e+01,
6158           0.8288040568796e-08, 0.5234914433867e+01, 0.1241658836951e+02,
6159           0.6359381347255e-08, 0.4137989441490e+01, 0.1596186371003e+01,
6160           0.8699572228626e-08, 0.1758411009497e+01, 0.6133512519065e+01,
6161           0.6456797542736e-08, 0.5919285089994e+01, 0.1685848245639e+02,
6162           0.7424573475452e-08, 0.5414616938827e+01, 0.4061219149443e+01,
6163           0.7235671196168e-08, 0.1496516557134e+01, 0.1610006857377e+03,
6164           0.8104015182733e-08, 0.1919918242764e+01, 0.8460828644453e+00,
6165           0.8098576535937e-08, 0.3819615855458e+01, 0.3894181736510e+01,
6166 
6167           0.6275292346625e-08, 0.6244264115141e+01, 0.8531963191132e+00,
6168           0.6052432989112e-08, 0.5037731872610e+00, 0.1567108171867e+02,
6169           0.5705651535817e-08, 0.2984557271995e+01, 0.1258692712880e+02,
6170           0.5789650115138e-08, 0.6087038140697e+01, 0.1193336791622e+02,
6171           0.5512132153377e-08, 0.5855668994076e+01, 0.1232342296471e+02,
6172           0.7388890819102e-08, 0.2443128574740e+01, 0.4907302013889e+01,
6173           0.5467593991798e-08, 0.3017561234194e+01, 0.1884211409667e+02,
6174           0.6388519802999e-08, 0.5887386712935e+01, 0.5217580628120e+02,
6175           0.6106777149944e-08, 0.3483461059895e+00, 0.1422690933580e-01,
6176           0.7383420275489e-08, 0.5417387056707e+01, 0.2358125818164e+02,
6177 
6178           0.5505208141738e-08, 0.2848193644783e+01, 0.1151388321134e+02,
6179           0.6310757462877e-08, 0.2349882520828e+01, 0.1041998632314e+02,
6180           0.6166904929691e-08, 0.5728575944077e+00, 0.6151533897323e+01,
6181           0.5263442042754e-08, 0.4495796125937e+01, 0.1885275071096e+02,
6182           0.5591828082629e-08, 0.1355441967677e+01, 0.4337116142245e+00,
6183           0.5397051680497e-08, 0.1673422864307e+01, 0.6286362197481e+01,
6184           0.5396992745159e-08, 0.1833502206373e+01, 0.6279789503410e+01,
6185           0.6572913000726e-08, 0.3331122065824e+01, 0.1176433076753e+02,
6186           0.5123421866413e-08, 0.2165327142679e+01, 0.1245594543367e+02,
6187           0.5930495725999e-08, 0.2931146089284e+01, 0.6414617803568e+01,
6188 
6189           0.6431797403933e-08, 0.4134407994088e+01, 0.1350651127443e+00,
6190           0.5003182207604e-08, 0.3805420303749e+01, 0.1096996532989e+02,
6191           0.5587731032504e-08, 0.1082469260599e+01, 0.6062663316000e+01,
6192           0.5935263407816e-08, 0.8384333678401e+00, 0.5326786718777e+01,
6193           0.4756019827760e-08, 0.3552588749309e+01, 0.3104930017775e+01,
6194           0.6599951172637e-08, 0.4320826409528e+01, 0.4087944051283e+02,
6195           0.5902606868464e-08, 0.4811879454445e+01, 0.5849364236221e+01,
6196           0.5921147809031e-08, 0.9942628922396e-01, 0.1581959461667e+01,
6197           0.5505382581266e-08, 0.2466557607764e+01, 0.6503488384892e+01,
6198           0.5353771071862e-08, 0.4551978748683e+01, 0.1735668374386e+03,
6199 
6200           0.5063282210946e-08, 0.5710812312425e+01, 0.1248988586463e+02,
6201           0.5926120403383e-08, 0.1333998428358e+01, 0.2673594526851e+02,
6202           0.5211016176149e-08, 0.4649315360760e+01, 0.2460261242967e+02,
6203           0.5347075084894e-08, 0.5512754081205e+01, 0.4171425416666e+01,
6204           0.4872609773574e-08, 0.1308025299938e+01, 0.5333900173445e+01,
6205           0.4727711321420e-08, 0.2144908368062e+01, 0.7232251527446e+01,
6206           0.6029426018652e-08, 0.5567259412084e+01, 0.3227113045244e+03,
6207           0.4321485284369e-08, 0.5230667156451e+01, 0.9388005868221e+01,
6208           0.4476406760553e-08, 0.6134081115303e+01, 0.5547199253223e+01,
6209           0.5835268277420e-08, 0.4783808492071e+01, 0.7285056171570e+02,
6210 
6211           0.5172183602748e-08, 0.5161817911099e+01, 0.1884570439172e+02,
6212           0.5693571465184e-08, 0.1381646203111e+01, 0.9723862754494e+02,
6213           0.4060634965349e-08, 0.3876705259495e+00, 0.4274518229222e+01,
6214           0.3967398770473e-08, 0.5029491776223e+01, 0.3496032717521e+01,
6215           0.3943754005255e-08, 0.1923162955490e+01, 0.6244942932314e+01,
6216           0.4781323427824e-08, 0.4633332586423e+01, 0.2929661536378e+02,
6217           0.3871483781204e-08, 0.1616650009743e+01, 0.6321208768577e+01,
6218           0.5141741733997e-08, 0.9817316704659e-01, 0.1232032006293e+02,
6219           0.4002385978497e-08, 0.3656161212139e+01, 0.7018952447668e+01,
6220           0.4901092604097e-08, 0.4404098713092e+01, 0.1478866649112e+01,
6221 
6222           0.3740932630345e-08, 0.5181188732639e+00, 0.6922973089781e+01,
6223           0.4387283718538e-08, 0.3254859566869e+01, 0.2331413144044e+03,
6224           0.5019197802033e-08, 0.3086773224677e+01, 0.1715706182245e+02,
6225           0.3834931695175e-08, 0.2797882673542e+01, 0.1491901785440e+02,
6226           0.3760413942497e-08, 0.2892676280217e+01, 0.1726726808967e+02,
6227           0.3719717204628e-08, 0.5861046025739e+01, 0.6297302759782e+01,
6228           0.4145623530149e-08, 0.2168239627033e+01, 0.1376059875786e+02,
6229           0.3932788425380e-08, 0.6271811124181e+01, 0.7872148766781e+01,
6230           0.3686377476857e-08, 0.3936853151404e+01, 0.6268848941110e+01,
6231           0.3779077950339e-08, 0.1404148734043e+01, 0.4157198507331e+01,
6232 
6233           0.4091334550598e-08, 0.2452436180854e+01, 0.9779108567966e+01,
6234           0.3926694536146e-08, 0.6102292739040e+01, 0.1098419223922e+02,
6235           0.4841000253289e-08, 0.6072760457276e+01, 0.1252801878276e+02,
6236           0.4949340130240e-08, 0.1154832815171e+01, 0.1617106187867e+03,
6237           0.3761557737360e-08, 0.5527545321897e+01, 0.3185192151914e+01,
6238           0.3647396268188e-08, 0.1525035688629e+01, 0.6271346477544e+01,
6239           0.3932405074189e-08, 0.5570681040569e+01, 0.2139354194808e+02,
6240           0.3631322501141e-08, 0.1981240601160e+01, 0.6294805223347e+01,
6241           0.4130007425139e-08, 0.2050060880201e+01, 0.2195415756911e+02,
6242           0.4433905965176e-08, 0.3277477970321e+01, 0.7445550607224e+01,
6243 
6244           0.3851814176947e-08, 0.5210690074886e+01, 0.9562891316684e+00,
6245           0.3485807052785e-08, 0.6653274904611e+00, 0.1161697602389e+02,
6246           0.3979772816991e-08, 0.1767941436148e+01, 0.2277943724828e+02,
6247           0.3402607460500e-08, 0.3421746306465e+01, 0.1087398597200e+02,
6248           0.4049993000926e-08, 0.1127144787547e+01, 0.3163918923335e+00,
6249           0.3420511182382e-08, 0.4214794779161e+01, 0.1362553364512e+02,
6250           0.3640772365012e-08, 0.5324905497687e+01, 0.1725304118033e+02,
6251           0.3323037987501e-08, 0.6135761838271e+01, 0.6279143387820e+01,
6252           0.4503141663637e-08, 0.1802305450666e+01, 0.1385561574497e+01,
6253           0.4314560055588e-08, 0.4812299731574e+01, 0.4176041334900e+01,
6254 
6255           0.3294226949110e-08, 0.3657547059723e+01, 0.6287008313071e+01,
6256           0.3215657197281e-08, 0.4866676894425e+01, 0.5749861718712e+01,
6257           0.4129362656266e-08, 0.3809342558906e+01, 0.5905702259363e+01,
6258           0.3137762976388e-08, 0.2494635174443e+01, 0.2099539292909e+02,
6259           0.3514010952384e-08, 0.2699961831678e+01, 0.7335344340001e+01,
6260           0.3327607571530e-08, 0.3318457714816e+01, 0.5436992986000e+01,
6261           0.3541066946675e-08, 0.4382703582466e+01, 0.1234573916645e+02,
6262           0.3216179847052e-08, 0.5271066317054e+01, 0.3802769619140e-01,
6263           0.2959045059570e-08, 0.5819591585302e+01, 0.2670964694522e+02,
6264           0.3884040326665e-08, 0.5980934960428e+01, 0.6660449441528e+01,
6265 
6266           0.2922027539886e-08, 0.3337290282483e+01, 0.1375773836557e+01,
6267           0.4110846382042e-08, 0.5742978187327e+01, 0.4480965020977e+02,
6268           0.2934508411032e-08, 0.2278075804200e+01, 0.6408777551755e+00,
6269           0.3966896193000e-08, 0.5835747858477e+01, 0.3773735910827e+00,
6270           0.3286695827610e-08, 0.5838898193902e+01, 0.3932462625300e-02,
6271           0.3720643094196e-08, 0.1122212337858e+01, 0.1646033343740e+02,
6272           0.3285508906174e-08, 0.9182250996416e+00, 0.1081813534213e+02,
6273           0.3753880575973e-08, 0.5174761973266e+01, 0.5642198095270e+01,
6274           0.3022129385587e-08, 0.3381611020639e+01, 0.2982630633589e+02,
6275           0.2798569205621e-08, 0.3546193723922e+01, 0.1937891852345e+02,
6276 
6277           0.3397872070505e-08, 0.4533203197934e+01, 0.6923953605621e+01,
6278           0.3708099772977e-08, 0.2756168198616e+01, 0.3066615496545e+02,
6279           0.3599283541510e-08, 0.1934395469918e+01, 0.6147450479709e+01,
6280           0.3688702753059e-08, 0.7149920971109e+00, 0.2636725487657e+01,
6281           0.2681084724003e-08, 0.4899819493154e+01, 0.6816289982179e+01,
6282           0.3495993460759e-08, 0.1572418915115e+01, 0.6418701221183e+01,
6283           0.3130770324995e-08, 0.8912190180489e+00, 0.1235996607578e+02,
6284           0.2744353821941e-08, 0.3800821940055e+01, 0.2059724391010e+02,
6285           0.2842732906341e-08, 0.2644717440029e+01, 0.2828699048865e+02,
6286           0.3046882682154e-08, 0.3987793020179e+01, 0.6055599646783e+01,
6287 
6288           0.2399072455143e-08, 0.9908826440764e+00, 0.6255674361143e+01,
6289           0.2384306274204e-08, 0.2516149752220e+01, 0.6310477339748e+01,
6290           0.2977324500559e-08, 0.5849195642118e+01, 0.1652265972112e+02,
6291           0.3062835258972e-08, 0.1681660100162e+01, 0.1172006883645e+02,
6292           0.3109682589231e-08, 0.5804143987737e+00, 0.2751146787858e+02,
6293           0.2903920355299e-08, 0.5800768280123e+01, 0.6510552054109e+01,
6294           0.2823221989212e-08, 0.9241118370216e+00, 0.5469525544182e+01,
6295           0.3187949696649e-08, 0.3139776445735e+01, 0.1693792562116e+03,
6296           0.2922559771655e-08, 0.3549440782984e+01, 0.2630839062450e+00,
6297           0.2436302066603e-08, 0.4735540696319e+01, 0.3946258593675e+00,
6298 
6299           0.3049473043606e-08, 0.4998289124561e+01, 0.8390110365991e+01,
6300           0.2863682575784e-08, 0.6709515671102e+00, 0.2243449970715e+00,
6301           0.2641750517966e-08, 0.5410978257284e+01, 0.2986433403208e+02,
6302           0.2704093466243e-08, 0.4778317207821e+01, 0.6129297044991e+01,
6303           0.2445522177011e-08, 0.6009020662222e+01, 0.1171295538178e+02,
6304           0.2623608810230e-08, 0.5010449777147e+01, 0.6436854655901e+01,
6305           0.2079259704053e-08, 0.5980943768809e+01, 0.2019909489111e+02,
6306           0.2820225596771e-08, 0.2679965110468e+01, 0.5934151399930e+01,
6307           0.2365221950927e-08, 0.1894231148810e+01, 0.2470570524223e+02,
6308           0.2359682077149e-08, 0.4220752950780e+01, 0.8671969964381e+01,
6309 
6310           0.2387577137206e-08, 0.2571783940617e+01, 0.7096626156709e+01,
6311           0.1982102089816e-08, 0.5169765997119e+00, 0.1727188400790e+02,
6312           0.2687502389925e-08, 0.6239078264579e+01, 0.7075506709219e+02,
6313           0.2207751669135e-08, 0.2031184412677e+01, 0.4377611041777e+01,
6314           0.2618370214274e-08, 0.8266079985979e+00, 0.6632000300961e+01,
6315           0.2591951887361e-08, 0.8819350522008e+00, 0.4873985990671e+02,
6316           0.2375055656248e-08, 0.3520944177789e+01, 0.1590676413561e+02,
6317           0.2472019978911e-08, 0.1551431908671e+01, 0.6612329252343e+00,
6318           0.2368157127199e-08, 0.4178610147412e+01, 0.3459636466239e+02,
6319           0.1764846605693e-08, 0.1506764000157e+01, 0.1980094587212e+02,
6320 
6321           0.2291769608798e-08, 0.2118250611782e+01, 0.2844914056730e-01,
6322           0.2209997316943e-08, 0.3363255261678e+01, 0.2666070658668e+00,
6323           0.2292699097923e-08, 0.4200423956460e+00, 0.1484170571900e-02,
6324           0.1629683015329e-08, 0.2331362582487e+01, 0.3035599730800e+02,
6325           0.2206492862426e-08, 0.3400274026992e+01, 0.6281667977667e+01,
6326           0.2205746568257e-08, 0.1066051230724e+00, 0.6284483723224e+01,
6327           0.2026310767991e-08, 0.2779066487979e+01, 0.2449240616245e+02,
6328           0.1762977622163e-08, 0.9951450691840e+00, 0.2045286941806e+02,
6329           0.1368535049606e-08, 0.6402447365817e+00, 0.2473415438279e+02,
6330           0.1720598775450e-08, 0.2303524214705e+00, 0.1679593901136e+03,
6331 
6332           0.1702429015449e-08, 0.6164622655048e+01, 0.3338575901272e+03,
6333           0.1414033197685e-08, 0.3954561185580e+01, 0.1624205518357e+03,
6334           0.1573768958043e-08, 0.2028286308984e+01, 0.3144167757552e+02,
6335           0.1650705184447e-08, 0.2304040666128e+01, 0.5267006960365e+02,
6336           0.1651087618855e-08, 0.2538461057280e+01, 0.8956999012000e+02,
6337           0.1616409518983e-08, 0.5111054348152e+01, 0.3332657872986e+02,
6338           0.1537175173581e-08, 0.5601130666603e+01, 0.3852657435933e+02,
6339           0.1593191980553e-08, 0.2614340453411e+01, 0.2282781046519e+03,
6340           0.1499480170643e-08, 0.3624721577264e+01, 0.2823723341956e+02,
6341           0.1493807843235e-08, 0.4214569879008e+01, 0.2876692439167e+02,
6342 
6343           0.1074571199328e-08, 0.1496911744704e+00, 0.8397383534231e+02,
6344           0.1074406983417e-08, 0.1187817671922e+01, 0.8401985929482e+02,
6345           0.9757576855851e-09, 0.2655703035858e+01, 0.7826370942180e+02,
6346           0.1258432887565e-08, 0.4969896184844e+01, 0.3115650189215e+03,
6347           0.1240336343282e-08, 0.5192460776926e+01, 0.1784300471910e+03,
6348           0.9016107005164e-09, 0.1960356923057e+01, 0.5886454391678e+02,
6349           0.1135392360918e-08, 0.5082427809068e+01, 0.7842370451713e+02,
6350           0.9216046089565e-09, 0.2793775037273e+01, 0.1014262087719e+03,
6351           0.1061276615030e-08, 0.3726144311409e+01, 0.5660027930059e+02,
6352           0.1010110596263e-08, 0.7404080708937e+00, 0.4245678405627e+02,
6353 
6354           0.7217424756199e-09, 0.2697449980577e-01, 0.2457074661053e+03,
6355           0.6912003846756e-09, 0.4253296276335e+01, 0.1679936946371e+03,
6356           0.6871814664847e-09, 0.5148072412354e+01, 0.6053048899753e+02,
6357           0.4887158016343e-09, 0.2153581148294e+01, 0.9656299901946e+02,
6358           0.5161802866314e-09, 0.3852750634351e+01, 0.2442876000072e+03,
6359           0.5652599559057e-09, 0.1233233356270e+01, 0.8365903305582e+02,
6360           0.4710812608586e-09, 0.5610486976767e+01, 0.3164282286739e+03,
6361           0.4909977500324e-09, 0.1639629524123e+01, 0.4059982187939e+03,
6362           0.4772641839378e-09, 0.3737100368583e+01, 0.1805255418145e+03,
6363           0.4487562567153e-09, 0.1158417054478e+00, 0.8433466158131e+02,
6364 
6365           0.3943441230497e-09, 0.6243502862796e+00, 0.2568537517081e+03,
6366           0.3952236913598e-09, 0.3510377382385e+01, 0.2449975330562e+03,
6367           0.3788898363417e-09, 0.5916128302299e+01, 0.1568131045107e+03,
6368           0.3738329328831e-09, 0.1042266763456e+01, 0.3948519331910e+03,
6369           0.2451199165151e-09, 0.1166788435700e+01, 0.1435713242844e+03,
6370           0.2436734402904e-09, 0.3254726114901e+01, 0.2268582385539e+03,
6371           0.2213605274325e-09, 0.1687210598530e+01, 0.1658638954901e+03,
6372           0.1491521204829e-09, 0.2657541786794e+01, 0.2219950288015e+03,
6373           0.1474995329744e-09, 0.5013089805819e+01, 0.3052819430710e+03,
6374           0.1661939475656e-09, 0.5495315428418e+01, 0.2526661704812e+03,
6375 
6376           0.9015946748003e-10, 0.2236989966505e+01, 0.4171445043968e+03 };
6377 
6378     /* Sun-to-Earth, T^0, Z */
6379       static final double e0z[] = {
6380           0.2796207639075e-05, 0.3198701560209e+01, 0.8433466158131e+02,
6381           0.1016042198142e-05, 0.5422360395913e+01, 0.5507553240374e+01,
6382           0.8044305033647e-06, 0.3880222866652e+01, 0.5223693906222e+01,
6383           0.4385347909274e-06, 0.3704369937468e+01, 0.2352866153506e+01,
6384           0.3186156414906e-06, 0.3999639363235e+01, 0.1577343543434e+01,
6385           0.2272412285792e-06, 0.3984738315952e+01, 0.1047747311755e+01,
6386           0.1645620103007e-06, 0.3565412516841e+01, 0.5856477690889e+01,
6387           0.1815836921166e-06, 0.4984507059020e+01, 0.6283075850446e+01,
6388           0.1447461676364e-06, 0.3702753570108e+01, 0.9437762937313e+01,
6389           0.1430760876382e-06, 0.3409658712357e+01, 0.1021328554739e+02,
6390 
6391           0.1120445753226e-06, 0.4829561570246e+01, 0.1414349524433e+02,
6392           0.1090232840797e-06, 0.2080729178066e+01, 0.6812766822558e+01,
6393           0.9715727346551e-07, 0.3476295881948e+01, 0.4694002934110e+01,
6394           0.1036267136217e-06, 0.4056639536648e+01, 0.7109288135493e+02,
6395           0.8752665271340e-07, 0.4448159519911e+01, 0.5753384878334e+01,
6396           0.8331864956004e-07, 0.4991704044208e+01, 0.7084896783808e+01,
6397           0.6901658670245e-07, 0.4325358994219e+01, 0.6275962395778e+01,
6398           0.9144536848998e-07, 0.1141826375363e+01, 0.6620890113188e+01,
6399           0.7205085037435e-07, 0.3624344170143e+01, 0.5296909721118e+00,
6400           0.7697874654176e-07, 0.5554257458998e+01, 0.1676215758509e+03,
6401 
6402           0.5197545738384e-07, 0.6251760961735e+01, 0.1807370494127e+02,
6403           0.5031345378608e-07, 0.2497341091913e+01, 0.4705732307012e+01,
6404           0.4527110205840e-07, 0.2335079920992e+01, 0.6309374173736e+01,
6405           0.4753355798089e-07, 0.7094148987474e+00, 0.5884926831456e+01,
6406           0.4296951977516e-07, 0.1101916352091e+01, 0.6681224869435e+01,
6407           0.3855341568387e-07, 0.1825495405486e+01, 0.5486777812467e+01,
6408           0.5253930970990e-07, 0.4424740687208e+01, 0.7860419393880e+01,
6409           0.4024630496471e-07, 0.5120498157053e+01, 0.1336797263425e+02,
6410           0.4061069791453e-07, 0.6029771435451e+01, 0.3930209696940e+01,
6411           0.3797883804205e-07, 0.4435193600836e+00, 0.3154687086868e+01,
6412 
6413           0.2933033225587e-07, 0.5124157356507e+01, 0.1059381944224e+01,
6414           0.3503000930426e-07, 0.5421830162065e+01, 0.6069776770667e+01,
6415           0.3670096214050e-07, 0.4582101667297e+01, 0.1219403291462e+02,
6416           0.2905609437008e-07, 0.1926566420072e+01, 0.1097707878456e+02,
6417           0.2466827821713e-07, 0.6090174539834e+00, 0.6496374930224e+01,
6418           0.2691647295332e-07, 0.1393432595077e+01, 0.2200391463820e+02,
6419           0.2150554667946e-07, 0.4308671715951e+01, 0.5643178611111e+01,
6420           0.2237481922680e-07, 0.8133968269414e+00, 0.8635942003952e+01,
6421           0.1817741038157e-07, 0.3755205127454e+01, 0.3340612434717e+01,
6422           0.2227820762132e-07, 0.2759558596664e+01, 0.1203646072878e+02,
6423 
6424           0.1944713772307e-07, 0.5699645869121e+01, 0.1179062909082e+02,
6425           0.1527340520662e-07, 0.1986749091746e+01, 0.3981490189893e+00,
6426           0.1577282574914e-07, 0.3205017217983e+01, 0.5088628793478e+01,
6427           0.1424738825424e-07, 0.6256747903666e+01, 0.2544314396739e+01,
6428           0.1616563121701e-07, 0.2601671259394e+00, 0.1729818233119e+02,
6429           0.1401210391692e-07, 0.4686939173506e+01, 0.7058598460518e+01,
6430           0.1488726974214e-07, 0.2815862451372e+01, 0.2593412433514e+02,
6431           0.1692626442388e-07, 0.4956894109797e+01, 0.1564752902480e+03,
6432           0.1123571582910e-07, 0.2381192697696e+01, 0.3738761453707e+01,
6433           0.9903308606317e-08, 0.4294851657684e+01, 0.9225539266174e+01,
6434 
6435           0.9174533187191e-08, 0.3075171510642e+01, 0.4164311961999e+01,
6436           0.8645985631457e-08, 0.5477534821633e+00, 0.8429241228195e+01,
6437          -0.1085876492688e-07, 0.0000000000000e+00, 0.0000000000000e+00,
6438           0.9264309077815e-08, 0.5968571670097e+01, 0.7079373888424e+01,
6439           0.8243116984954e-08, 0.1489098777643e+01, 0.1044738781244e+02,
6440           0.8268102113708e-08, 0.3512977691983e+01, 0.1150676975667e+02,
6441           0.9043613988227e-08, 0.1290704408221e+00, 0.1101510648075e+02,
6442           0.7432912038789e-08, 0.1991086893337e+01, 0.2608790314060e+02,
6443           0.8586233727285e-08, 0.4238357924414e+01, 0.2986433403208e+02,
6444           0.7612230060131e-08, 0.2911090150166e+01, 0.4732030630302e+01,
6445 
6446           0.7097787751408e-08, 0.1908938392390e+01, 0.8031092209206e+01,
6447           0.7640237040175e-08, 0.6129219000168e+00, 0.7962980379786e+00,
6448           0.7070445688081e-08, 0.1380417036651e+01, 0.2146165377750e+01,
6449           0.7690770957702e-08, 0.1680504249084e+01, 0.2122839202813e+02,
6450           0.8051292542594e-08, 0.5127423484511e+01, 0.2942463415728e+01,
6451           0.5902709104515e-08, 0.2020274190917e+01, 0.7755226100720e+00,
6452           0.5134567496462e-08, 0.2606778676418e+01, 0.1256615170089e+02,
6453           0.5525802046102e-08, 0.1613011769663e+01, 0.8018209333619e+00,
6454           0.5880724784221e-08, 0.4604483417236e+01, 0.4690479774488e+01,
6455           0.5211699081370e-08, 0.5718964114193e+01, 0.8827390247185e+01,
6456 
6457           0.4891849573562e-08, 0.3689658932196e+01, 0.2132990797783e+00,
6458           0.5150246069997e-08, 0.4099769855122e+01, 0.6480980550449e+02,
6459           0.5102434319633e-08, 0.5660834602509e+01, 0.3379454372902e+02,
6460           0.5083405254252e-08, 0.9842221218974e+00, 0.4136910472696e+01,
6461           0.4206562585682e-08, 0.1341363634163e+00, 0.3128388763578e+01,
6462           0.4663249683579e-08, 0.8130132735866e+00, 0.5216580451554e+01,
6463           0.4099474416530e-08, 0.5791497770644e+01, 0.4265981595566e+00,
6464           0.4628251220767e-08, 0.1249802769331e+01, 0.1572083878776e+02,
6465           0.5024068728142e-08, 0.4795684802743e+01, 0.6290189305114e+01,
6466           0.5120234327758e-08, 0.3810420387208e+01, 0.5230807360890e+01,
6467 
6468           0.5524029815280e-08, 0.1029264714351e+01, 0.2397622045175e+03,
6469           0.4757415718860e-08, 0.3528044781779e+01, 0.1649636139783e+02,
6470           0.3915786131127e-08, 0.5593889282646e+01, 0.1589072916335e+01,
6471           0.4869053149991e-08, 0.3299636454433e+01, 0.7632943190217e+01,
6472           0.3649365703729e-08, 0.1286049002584e+01, 0.6206810014183e+01,
6473           0.3992493949002e-08, 0.3100307589464e+01, 0.2515860172507e+02,
6474           0.3320247477418e-08, 0.6212683940807e+01, 0.1216800268190e+02,
6475           0.3287123739696e-08, 0.4699118445928e+01, 0.7234794171227e+01,
6476           0.3472776811103e-08, 0.2630507142004e+01, 0.7342457794669e+01,
6477           0.3423253294767e-08, 0.2946432844305e+01, 0.9623688285163e+01,
6478 
6479           0.3896173898244e-08, 0.1224834179264e+01, 0.6438496133249e+01,
6480           0.3388455337924e-08, 0.1543807616351e+01, 0.1494531617769e+02,
6481           0.3062704716523e-08, 0.1191777572310e+01, 0.8662240327241e+01,
6482           0.3270075600400e-08, 0.5483498767737e+01, 0.1194447056968e+01,
6483           0.3101209215259e-08, 0.8000833804348e+00, 0.3772475342596e+02,
6484           0.2780883347311e-08, 0.4077980721888e+00, 0.5863591145557e+01,
6485           0.2903605931824e-08, 0.2617490302147e+01, 0.1965104848470e+02,
6486           0.2682014743119e-08, 0.2634703158290e+01, 0.7238675589263e+01,
6487           0.2534360108492e-08, 0.6102446114873e+01, 0.6836645152238e+01,
6488           0.2392564882509e-08, 0.3681820208691e+01, 0.5849364236221e+01,
6489 
6490           0.2656667254856e-08, 0.6216045388886e+01, 0.6133512519065e+01,
6491           0.2331242096773e-08, 0.5864949777744e+01, 0.4535059491685e+01,
6492           0.2287898363668e-08, 0.4566628532802e+01, 0.7477522907414e+01,
6493           0.2336944521306e-08, 0.2442722126930e+01, 0.1137170464392e+02,
6494           0.3156632236269e-08, 0.1626628050682e+01, 0.2509084901204e+03,
6495           0.2982612402766e-08, 0.2803604512609e+01, 0.1748016358760e+01,
6496           0.2774031674807e-08, 0.4654002897158e+01, 0.8223916695780e+02,
6497           0.2295236548638e-08, 0.4326518333253e+01, 0.3378142627421e+00,
6498           0.2190714699873e-08, 0.4519614578328e+01, 0.2908881142201e+02,
6499           0.2191495845045e-08, 0.3012626912549e+01, 0.1673046366289e+02,
6500 
6501           0.2492901628386e-08, 0.1290101424052e+00, 0.1543797956245e+03,
6502           0.1993778064319e-08, 0.3864046799414e+01, 0.1778984560711e+02,
6503           0.1898146479022e-08, 0.5053777235891e+01, 0.2042657109477e+02,
6504           0.1918280127634e-08, 0.2222470192548e+01, 0.4165496312290e+02,
6505           0.1916351061607e-08, 0.8719067257774e+00, 0.7737595720538e+02,
6506           0.1834720181466e-08, 0.4031491098040e+01, 0.2358125818164e+02,
6507           0.1249201523806e-08, 0.5938379466835e+01, 0.3301902111895e+02,
6508           0.1477304050539e-08, 0.6544722606797e+00, 0.9548094718417e+02,
6509           0.1264316431249e-08, 0.2059072853236e+01, 0.8399684731857e+02,
6510           0.1203526495039e-08, 0.3644813532605e+01, 0.4558517281984e+02,
6511 
6512           0.9221681059831e-09, 0.3241815055602e+01, 0.7805158573086e+02,
6513           0.7849278367646e-09, 0.5043812342457e+01, 0.5217580628120e+02,
6514           0.7983392077387e-09, 0.5000024502753e+01, 0.1501922143975e+03,
6515           0.7925395431654e-09, 0.1398734871821e-01, 0.9061773743175e+02,
6516           0.7640473285886e-09, 0.5067111723130e+01, 0.4951538251678e+02,
6517           0.5398937754482e-09, 0.5597382200075e+01, 0.1613385000004e+03,
6518           0.5626247550193e-09, 0.2601338209422e+01, 0.7318837597844e+02,
6519           0.5525197197855e-09, 0.5814832109256e+01, 0.1432335100216e+03,
6520           0.5407629837898e-09, 0.3384820609076e+01, 0.3230491187871e+03,
6521           0.3856739119801e-09, 0.1072391840473e+01, 0.2334791286671e+03,
6522 
6523           0.3856425239987e-09, 0.2369540393327e+01, 0.1739046517013e+03,
6524           0.4350867755983e-09, 0.5255575751082e+01, 0.1620484330494e+03,
6525           0.3844113924996e-09, 0.5482356246182e+01, 0.9757644180768e+02,
6526           0.2854869155431e-09, 0.9573634763143e+00, 0.1697170704744e+03,
6527           0.1719227671416e-09, 0.1887203025202e+01, 0.2265204242912e+03,
6528           0.1527846879755e-09, 0.3982183931157e+01, 0.3341954043900e+03,
6529           0.1128229264847e-09, 0.2787457156298e+01, 0.3119028331842e+03 };
6530 
6531     /* Sun-to-Earth, T^1, X */
6532       static final double e1x[] = {
6533           0.1234046326004e-05, 0.0000000000000e+00, 0.0000000000000e+00,
6534           0.5150068824701e-06, 0.6002664557501e+01, 0.1256615170089e+02,
6535           0.1290743923245e-07, 0.5959437664199e+01, 0.1884922755134e+02,
6536           0.1068615564952e-07, 0.2015529654209e+01, 0.6283075850446e+01,
6537           0.2079619142538e-08, 0.1732960531432e+01, 0.6279552690824e+01,
6538           0.2078009243969e-08, 0.4915604476996e+01, 0.6286599010068e+01,
6539           0.6206330058856e-09, 0.3616457953824e+00, 0.4705732307012e+01,
6540           0.5989335313746e-09, 0.3802607304474e+01, 0.6256777527156e+01,
6541           0.5958495663840e-09, 0.2845866560031e+01, 0.6309374173736e+01,
6542           0.4866923261539e-09, 0.5213203771824e+01, 0.7755226100720e+00,
6543 
6544           0.4267785823142e-09, 0.4368189727818e+00, 0.1059381944224e+01,
6545           0.4610675141648e-09, 0.1837249181372e-01, 0.7860419393880e+01,
6546           0.3626989993973e-09, 0.2161590545326e+01, 0.5753384878334e+01,
6547           0.3563071194389e-09, 0.1452631954746e+01, 0.5884926831456e+01,
6548           0.3557015642807e-09, 0.4470593393054e+01, 0.6812766822558e+01,
6549           0.3210412089122e-09, 0.5195926078314e+01, 0.6681224869435e+01,
6550           0.2875473577986e-09, 0.5916256610193e+01, 0.2513230340178e+02,
6551           0.2842913681629e-09, 0.1149902426047e+01, 0.6127655567643e+01,
6552           0.2751248215916e-09, 0.5502088574662e+01, 0.6438496133249e+01,
6553           0.2481432881127e-09, 0.2921989846637e+01, 0.5486777812467e+01,
6554 
6555           0.2059885976560e-09, 0.3718070376585e+01, 0.7079373888424e+01,
6556           0.2015522342591e-09, 0.5979395259740e+01, 0.6290189305114e+01,
6557           0.1995364084253e-09, 0.6772087985494e+00, 0.6275962395778e+01,
6558           0.1957436436943e-09, 0.2899210654665e+01, 0.5507553240374e+01,
6559           0.1651609818948e-09, 0.6228206482192e+01, 0.1150676975667e+02,
6560           0.1822980550699e-09, 0.1469348746179e+01, 0.1179062909082e+02,
6561           0.1675223159760e-09, 0.3813910555688e+01, 0.7058598460518e+01,
6562           0.1706491764745e-09, 0.3004380506684e+00, 0.7113454667900e-02,
6563           0.1392952362615e-09, 0.1440393973406e+01, 0.7962980379786e+00,
6564           0.1209868266342e-09, 0.4150425791727e+01, 0.4694002934110e+01,
6565 
6566           0.1009827202611e-09, 0.3290040429843e+01, 0.3738761453707e+01,
6567           0.1047261388602e-09, 0.4229590090227e+01, 0.6282095334605e+01,
6568           0.1047006652004e-09, 0.2418967680575e+01, 0.6284056366286e+01,
6569           0.9609993143095e-10, 0.4627943659201e+01, 0.6069776770667e+01,
6570           0.9590900593873e-10, 0.1894393939924e+01, 0.4136910472696e+01,
6571           0.9146249188071e-10, 0.2010647519562e+01, 0.6496374930224e+01,
6572           0.8545274480290e-10, 0.5529846956226e-01, 0.1194447056968e+01,
6573           0.8224377881194e-10, 0.1254304102174e+01, 0.1589072916335e+01,
6574           0.6183529510410e-10, 0.3360862168815e+01, 0.8827390247185e+01,
6575           0.6259255147141e-10, 0.4755628243179e+01, 0.8429241228195e+01,
6576 
6577           0.5539291694151e-10, 0.5371746955142e+01, 0.4933208510675e+01,
6578           0.7328259466314e-10, 0.4927699613906e+00, 0.4535059491685e+01,
6579           0.6017835843560e-10, 0.5776682001734e-01, 0.1255903824622e+02,
6580           0.7079827775243e-10, 0.4395059432251e+01, 0.5088628793478e+01,
6581           0.5170358878213e-10, 0.5154062619954e+01, 0.1176985366291e+02,
6582           0.4872301838682e-10, 0.6289611648973e+00, 0.6040347114260e+01,
6583           0.5249869411058e-10, 0.5617272046949e+01, 0.3154687086868e+01,
6584           0.4716172354411e-10, 0.3965901800877e+01, 0.5331357529664e+01,
6585           0.4871214940964e-10, 0.4627507050093e+01, 0.1256967486051e+02,
6586           0.4598076850751e-10, 0.6023631226459e+01, 0.6525804586632e+01,
6587 
6588           0.4562196089485e-10, 0.4138562084068e+01, 0.3930209696940e+01,
6589           0.4325493872224e-10, 0.1330845906564e+01, 0.7632943190217e+01,
6590           0.5673781176748e-10, 0.2558752615657e+01, 0.5729506548653e+01,
6591           0.3961436642503e-10, 0.2728071734630e+01, 0.7234794171227e+01,
6592           0.5101868209058e-10, 0.4113444965144e+01, 0.6836645152238e+01,
6593           0.5257043167676e-10, 0.6195089830590e+01, 0.8031092209206e+01,
6594           0.5076613989393e-10, 0.2305124132918e+01, 0.7477522907414e+01,
6595           0.3342169352778e-10, 0.5415998155071e+01, 0.1097707878456e+02,
6596           0.3545881983591e-10, 0.3727160564574e+01, 0.4164311961999e+01,
6597           0.3364063738599e-10, 0.2901121049204e+00, 0.1137170464392e+02,
6598 
6599           0.3357039670776e-10, 0.1652229354331e+01, 0.5223693906222e+01,
6600           0.4307412268687e-10, 0.4938909587445e+01, 0.1592596075957e+01,
6601           0.3405769115435e-10, 0.2408890766511e+01, 0.3128388763578e+01,
6602           0.3001926198480e-10, 0.4862239006386e+01, 0.1748016358760e+01,
6603           0.2778264787325e-10, 0.5241168661353e+01, 0.7342457794669e+01,
6604           0.2676159480666e-10, 0.3423593942199e+01, 0.2146165377750e+01,
6605           0.2954273399939e-10, 0.1881721265406e+01, 0.5368044267797e+00,
6606           0.3309362888795e-10, 0.1931525677349e+01, 0.8018209333619e+00,
6607           0.2810283608438e-10, 0.2414659495050e+01, 0.5225775174439e+00,
6608           0.3378045637764e-10, 0.4238019163430e+01, 0.1554202828031e+00,
6609 
6610           0.2558134979840e-10, 0.1828225235805e+01, 0.5230807360890e+01,
6611           0.2273755578447e-10, 0.5858184283998e+01, 0.7084896783808e+01,
6612           0.2294176037690e-10, 0.4514589779057e+01, 0.1726015463500e+02,
6613           0.2533506099435e-10, 0.2355717851551e+01, 0.5216580451554e+01,
6614           0.2716685375812e-10, 0.2221003625100e+01, 0.8635942003952e+01,
6615           0.2419043435198e-10, 0.5955704951635e+01, 0.4690479774488e+01,
6616           0.2521232544812e-10, 0.1395676848521e+01, 0.5481254917084e+01,
6617           0.2630195021491e-10, 0.5727468918743e+01, 0.2629832328990e-01,
6618           0.2548395840944e-10, 0.2628351859400e-03, 0.1349867339771e+01 };
6619 
6620     /* Sun-to-Earth, T^1, Y */
6621       static final double e1y[] = {
6622           0.9304690546528e-06, 0.0000000000000e+00, 0.0000000000000e+00,
6623           0.5150715570663e-06, 0.4431807116294e+01, 0.1256615170089e+02,
6624           0.1290825411056e-07, 0.4388610039678e+01, 0.1884922755134e+02,
6625           0.4645466665386e-08, 0.5827263376034e+01, 0.6283075850446e+01,
6626           0.2079625310718e-08, 0.1621698662282e+00, 0.6279552690824e+01,
6627           0.2078189850907e-08, 0.3344713435140e+01, 0.6286599010068e+01,
6628           0.6207190138027e-09, 0.5074049319576e+01, 0.4705732307012e+01,
6629           0.5989826532569e-09, 0.2231842216620e+01, 0.6256777527156e+01,
6630           0.5961360812618e-09, 0.1274975769045e+01, 0.6309374173736e+01,
6631           0.4874165471016e-09, 0.3642277426779e+01, 0.7755226100720e+00,
6632 
6633           0.4283834034360e-09, 0.5148765510106e+01, 0.1059381944224e+01,
6634           0.4652389287529e-09, 0.4715794792175e+01, 0.7860419393880e+01,
6635           0.3751707476401e-09, 0.6617207370325e+00, 0.5753384878334e+01,
6636           0.3559998806198e-09, 0.6155548875404e+01, 0.5884926831456e+01,
6637           0.3558447558857e-09, 0.2898827297664e+01, 0.6812766822558e+01,
6638           0.3211116927106e-09, 0.3625813502509e+01, 0.6681224869435e+01,
6639           0.2875609914672e-09, 0.4345435813134e+01, 0.2513230340178e+02,
6640           0.2843109704069e-09, 0.5862263940038e+01, 0.6127655567643e+01,
6641           0.2744676468427e-09, 0.3926419475089e+01, 0.6438496133249e+01,
6642           0.2481285237789e-09, 0.1351976572828e+01, 0.5486777812467e+01,
6643 
6644           0.2060338481033e-09, 0.2147556998591e+01, 0.7079373888424e+01,
6645           0.2015822358331e-09, 0.4408358972216e+01, 0.6290189305114e+01,
6646           0.2001195944195e-09, 0.5385829822531e+01, 0.6275962395778e+01,
6647           0.1953667642377e-09, 0.1304933746120e+01, 0.5507553240374e+01,
6648           0.1839744078713e-09, 0.6173567228835e+01, 0.1179062909082e+02,
6649           0.1643334294845e-09, 0.4635942997523e+01, 0.1150676975667e+02,
6650           0.1768051018652e-09, 0.5086283558874e+01, 0.7113454667900e-02,
6651           0.1674874205489e-09, 0.2243332137241e+01, 0.7058598460518e+01,
6652           0.1421445397609e-09, 0.6186899771515e+01, 0.7962980379786e+00,
6653           0.1255163958267e-09, 0.5730238465658e+01, 0.4694002934110e+01,
6654 
6655           0.1013945281961e-09, 0.1726055228402e+01, 0.3738761453707e+01,
6656           0.1047294335852e-09, 0.2658801228129e+01, 0.6282095334605e+01,
6657           0.1047103879392e-09, 0.8481047835035e+00, 0.6284056366286e+01,
6658           0.9530343962826e-10, 0.3079267149859e+01, 0.6069776770667e+01,
6659           0.9604637611690e-10, 0.3258679792918e+00, 0.4136910472696e+01,
6660           0.9153518537177e-10, 0.4398599886584e+00, 0.6496374930224e+01,
6661           0.8562458214922e-10, 0.4772686794145e+01, 0.1194447056968e+01,
6662           0.8232525360654e-10, 0.5966220721679e+01, 0.1589072916335e+01,
6663           0.6150223411438e-10, 0.1780985591923e+01, 0.8827390247185e+01,
6664           0.6272087858000e-10, 0.3184305429012e+01, 0.8429241228195e+01,
6665 
6666           0.5540476311040e-10, 0.3801260595433e+01, 0.4933208510675e+01,
6667           0.7331901699361e-10, 0.5205948591865e+01, 0.4535059491685e+01,
6668           0.6018528702791e-10, 0.4770139083623e+01, 0.1255903824622e+02,
6669           0.5150530724804e-10, 0.3574796899585e+01, 0.1176985366291e+02,
6670           0.6471933741811e-10, 0.2679787266521e+01, 0.5088628793478e+01,
6671           0.5317460644174e-10, 0.9528763345494e+00, 0.3154687086868e+01,
6672           0.4832187748783e-10, 0.5329322498232e+01, 0.6040347114260e+01,
6673           0.4716763555110e-10, 0.2395235316466e+01, 0.5331357529664e+01,
6674           0.4871509139861e-10, 0.3056663648823e+01, 0.1256967486051e+02,
6675           0.4598417696768e-10, 0.4452762609019e+01, 0.6525804586632e+01,
6676 
6677           0.5674189533175e-10, 0.9879680872193e+00, 0.5729506548653e+01,
6678           0.4073560328195e-10, 0.5939127696986e+01, 0.7632943190217e+01,
6679           0.5040994945359e-10, 0.4549875824510e+01, 0.8031092209206e+01,
6680           0.5078185134679e-10, 0.7346659893982e+00, 0.7477522907414e+01,
6681           0.3769343537061e-10, 0.1071317188367e+01, 0.7234794171227e+01,
6682           0.4980331365299e-10, 0.2500345341784e+01, 0.6836645152238e+01,
6683           0.3458236594757e-10, 0.3825159450711e+01, 0.1097707878456e+02,
6684           0.3578859493602e-10, 0.5299664791549e+01, 0.4164311961999e+01,
6685           0.3370504646419e-10, 0.5002316301593e+01, 0.1137170464392e+02,
6686           0.3299873338428e-10, 0.2526123275282e+01, 0.3930209696940e+01,
6687 
6688           0.4304917318409e-10, 0.3368078557132e+01, 0.1592596075957e+01,
6689           0.3402418753455e-10, 0.8385495425800e+00, 0.3128388763578e+01,
6690           0.2778460572146e-10, 0.3669905203240e+01, 0.7342457794669e+01,
6691           0.2782710128902e-10, 0.2691664812170e+00, 0.1748016358760e+01,
6692           0.2711725179646e-10, 0.4707487217718e+01, 0.5296909721118e+00,
6693           0.2981760946340e-10, 0.3190260867816e+00, 0.5368044267797e+00,
6694           0.2811672977772e-10, 0.3196532315372e+01, 0.7084896783808e+01,
6695           0.2863454474467e-10, 0.2263240324780e+00, 0.5223693906222e+01,
6696           0.3333464634051e-10, 0.3498451685065e+01, 0.8018209333619e+00,
6697           0.3312991747609e-10, 0.5839154477412e+01, 0.1554202828031e+00,
6698 
6699           0.2813255564006e-10, 0.8268044346621e+00, 0.5225775174439e+00,
6700           0.2665098083966e-10, 0.3934021725360e+01, 0.5216580451554e+01,
6701           0.2349795705216e-10, 0.5197620913779e+01, 0.2146165377750e+01,
6702           0.2330352293961e-10, 0.2984999231807e+01, 0.1726015463500e+02,
6703           0.2728001683419e-10, 0.6521679638544e+00, 0.8635942003952e+01,
6704           0.2484061007669e-10, 0.3468955561097e+01, 0.5230807360890e+01,
6705           0.2646328768427e-10, 0.1013724533516e+01, 0.2629832328990e-01,
6706           0.2518630264831e-10, 0.6108081057122e+01, 0.5481254917084e+01,
6707           0.2421901455384e-10, 0.1651097776260e+01, 0.1349867339771e+01,
6708           0.6348533267831e-11, 0.3220226560321e+01, 0.8433466158131e+02 };
6709 
6710     /* Sun-to-Earth, T^1, Z */
6711       static final double e1z[] = {
6712           0.2278290449966e-05, 0.3413716033863e+01, 0.6283075850446e+01,
6713           0.5429458209830e-07, 0.0000000000000e+00, 0.0000000000000e+00,
6714           0.1903240492525e-07, 0.3370592358297e+01, 0.1256615170089e+02,
6715           0.2385409276743e-09, 0.3327914718416e+01, 0.1884922755134e+02,
6716           0.8676928342573e-10, 0.1824006811264e+01, 0.5223693906222e+01,
6717           0.7765442593544e-10, 0.3888564279247e+01, 0.5507553240374e+01,
6718           0.7066158332715e-10, 0.5194267231944e+01, 0.2352866153506e+01,
6719           0.7092175288657e-10, 0.2333246960021e+01, 0.8399684731857e+02,
6720           0.5357582213535e-10, 0.2224031176619e+01, 0.5296909721118e+00,
6721           0.3828035865021e-10, 0.2156710933584e+01, 0.6279552690824e+01,
6722 
6723           0.3824857220427e-10, 0.1529755219915e+01, 0.6286599010068e+01,
6724           0.3286995181628e-10, 0.4879512900483e+01, 0.1021328554739e+02 };
6725 
6726     /* Sun-to-Earth, T^2, X */
6727       static final double e2x[] = {
6728          -0.4143818297913e-10, 0.0000000000000e+00, 0.0000000000000e+00,
6729           0.2171497694435e-10, 0.4398225628264e+01, 0.1256615170089e+02,
6730           0.9845398442516e-11, 0.2079720838384e+00, 0.6283075850446e+01,
6731           0.9256833552682e-12, 0.4191264694361e+01, 0.1884922755134e+02,
6732           0.1022049384115e-12, 0.5381133195658e+01, 0.8399684731857e+02 };
6733 
6734     /* Sun-to-Earth, T^2, Y */
6735       static final double e2y[] = {
6736           0.5063375872532e-10, 0.0000000000000e+00, 0.0000000000000e+00,
6737           0.2173815785980e-10, 0.2827805833053e+01, 0.1256615170089e+02,
6738           0.1010231999920e-10, 0.4634612377133e+01, 0.6283075850446e+01,
6739           0.9259745317636e-12, 0.2620612076189e+01, 0.1884922755134e+02,
6740           0.1022202095812e-12, 0.3809562326066e+01, 0.8399684731857e+02 };
6741 
6742     /* Sun-to-Earth, T^2, Z */
6743       static final double e2z[] = {
6744           0.9722666114891e-10, 0.5152219582658e+01, 0.6283075850446e+01,
6745          -0.3494819171909e-11, 0.0000000000000e+00, 0.0000000000000e+00,
6746           0.6713034376076e-12, 0.6440188750495e+00, 0.1256615170089e+02 };
6747 
6748     }
6749       //subclassed the 
6750       private static class SSB {
6751     /* SSB-to-Sun, T^0, X */
6752       static final double s0x[] = {
6753           0.4956757536410e-02, 0.3741073751789e+01, 0.5296909721118e+00,
6754           0.2718490072522e-02, 0.4016011511425e+01, 0.2132990797783e+00,
6755           0.1546493974344e-02, 0.2170528330642e+01, 0.3813291813120e-01,
6756           0.8366855276341e-03, 0.2339614075294e+01, 0.7478166569050e-01,
6757           0.2936777942117e-03, 0.0000000000000e+00, 0.0000000000000e+00,
6758           0.1201317439469e-03, 0.4090736353305e+01, 0.1059381944224e+01,
6759           0.7578550887230e-04, 0.3241518088140e+01, 0.4265981595566e+00,
6760           0.1941787367773e-04, 0.1012202064330e+01, 0.2061856251104e+00,
6761           0.1889227765991e-04, 0.3892520416440e+01, 0.2204125344462e+00,
6762           0.1937896968613e-04, 0.4797779441161e+01, 0.1495633313810e+00,
6763 
6764           0.1434506110873e-04, 0.3868960697933e+01, 0.5225775174439e+00,
6765           0.1406659911580e-04, 0.4759766557397e+00, 0.5368044267797e+00,
6766           0.1179022300202e-04, 0.7774961520598e+00, 0.7626583626240e-01,
6767           0.8085864460959e-05, 0.3254654471465e+01, 0.3664874755930e-01,
6768           0.7622752967615e-05, 0.4227633103489e+01, 0.3961708870310e-01,
6769           0.6209171139066e-05, 0.2791828325711e+00, 0.7329749511860e-01,
6770           0.4366435633970e-05, 0.4440454875925e+01, 0.1589072916335e+01,
6771           0.3792124889348e-05, 0.5156393842356e+01, 0.7113454667900e-02,
6772           0.3154548963402e-05, 0.6157005730093e+01, 0.4194847048887e+00,
6773           0.3088359882942e-05, 0.2494567553163e+01, 0.6398972393349e+00,
6774 
6775           0.2788440902136e-05, 0.4934318747989e+01, 0.1102062672231e+00,
6776           0.3039928456376e-05, 0.4895077702640e+01, 0.6283075850446e+01,
6777           0.2272258457679e-05, 0.5278394064764e+01, 0.1030928125552e+00,
6778           0.2162007057957e-05, 0.5802978019099e+01, 0.3163918923335e+00,
6779           0.1767632855737e-05, 0.3415346595193e-01, 0.1021328554739e+02,
6780           0.1349413459362e-05, 0.2001643230755e+01, 0.1484170571900e-02,
6781           0.1170141900476e-05, 0.2424750491620e+01, 0.6327837846670e+00,
6782           0.1054355266820e-05, 0.3123311487576e+01, 0.4337116142245e+00,
6783           0.9800822461610e-06, 0.3026258088130e+01, 0.1052268489556e+01,
6784           0.1091203749931e-05, 0.3157811670347e+01, 0.1162474756779e+01,
6785 
6786           0.6960236715913e-06, 0.8219570542313e+00, 0.1066495398892e+01,
6787           0.5689257296909e-06, 0.1323052375236e+01, 0.9491756770005e+00,
6788           0.6613172135802e-06, 0.2765348881598e+00, 0.8460828644453e+00,
6789           0.6277702517571e-06, 0.5794064466382e+01, 0.1480791608091e+00,
6790           0.6304884066699e-06, 0.7323555380787e+00, 0.2243449970715e+00,
6791           0.4897850467382e-06, 0.3062464235399e+01, 0.3340612434717e+01,
6792           0.3759148598786e-06, 0.4588290469664e+01, 0.3516457698740e-01,
6793           0.3110520548195e-06, 0.1374299536572e+01, 0.6373574839730e-01,
6794           0.3064708359780e-06, 0.4222267485047e+01, 0.1104591729320e-01,
6795           0.2856347168241e-06, 0.3714202944973e+01, 0.1510475019529e+00,
6796 
6797           0.2840945514288e-06, 0.2847972875882e+01, 0.4110125927500e-01,
6798           0.2378951599405e-06, 0.3762072563388e+01, 0.2275259891141e+00,
6799           0.2714229481417e-06, 0.1036049980031e+01, 0.2535050500000e-01,
6800           0.2323551717307e-06, 0.4682388599076e+00, 0.8582758298370e-01,
6801           0.1881790512219e-06, 0.4790565425418e+01, 0.2118763888447e+01,
6802           0.2261353968371e-06, 0.1669144912212e+01, 0.7181332454670e-01,
6803           0.2214546389848e-06, 0.3937717281614e+01, 0.2968341143800e-02,
6804           0.2184915594933e-06, 0.1129169845099e+00, 0.7775000683430e-01,
6805           0.2000164937936e-06, 0.4030009638488e+01, 0.2093666171530e+00,
6806           0.1966105136719e-06, 0.8745955786834e+00, 0.2172315424036e+00,
6807 
6808           0.1904742332624e-06, 0.5919743598964e+01, 0.2022531624851e+00,
6809           0.1657399705031e-06, 0.2549141484884e+01, 0.7358765972222e+00,
6810           0.1574070533987e-06, 0.5277533020230e+01, 0.7429900518901e+00,
6811           0.1832261651039e-06, 0.3064688127777e+01, 0.3235053470014e+00,
6812           0.1733615346569e-06, 0.3011432799094e+01, 0.1385174140878e+00,
6813           0.1549124014496e-06, 0.4005569132359e+01, 0.5154640627760e+00,
6814           0.1637044713838e-06, 0.1831375966632e+01, 0.8531963191132e+00,
6815           0.1123420082383e-06, 0.1180270407578e+01, 0.1990721704425e+00,
6816           0.1083754165740e-06, 0.3414101320863e+00, 0.5439178814476e+00,
6817           0.1156638012655e-06, 0.6130479452594e+00, 0.5257585094865e+00,
6818 
6819           0.1142548785134e-06, 0.3724761948846e+01, 0.5336234347371e+00,
6820           0.7921463895965e-07, 0.2435425589361e+01, 0.1478866649112e+01,
6821           0.7428600285231e-07, 0.3542144398753e+01, 0.2164800718209e+00,
6822           0.8323211246747e-07, 0.3525058072354e+01, 0.1692165728891e+01,
6823           0.7257595116312e-07, 0.1364299431982e+01, 0.2101180877357e+00,
6824           0.7111185833236e-07, 0.2460478875808e+01, 0.4155522422634e+00,
6825           0.6868090383716e-07, 0.4397327670704e+01, 0.1173197218910e+00,
6826           0.7226419974175e-07, 0.4042647308905e+01, 0.1265567569334e+01,
6827           0.6955642383177e-07, 0.2865047906085e+01, 0.9562891316684e+00,
6828           0.7492139296331e-07, 0.5014278994215e+01, 0.1422690933580e-01,
6829 
6830           0.6598363128857e-07, 0.2376730020492e+01, 0.6470106940028e+00,
6831           0.7381147293385e-07, 0.3272990384244e+01, 0.1581959461667e+01,
6832           0.6402909624032e-07, 0.5302290955138e+01, 0.9597935788730e-01,
6833           0.6237454263857e-07, 0.5444144425332e+01, 0.7084920306520e-01,
6834           0.5241198544016e-07, 0.4215359579205e+01, 0.5265099800692e+00,
6835           0.5144463853918e-07, 0.1218916689916e+00, 0.5328719641544e+00,
6836           0.5868164772299e-07, 0.2369402002213e+01, 0.7871412831580e-01,
6837           0.6233195669151e-07, 0.1254922242403e+01, 0.2608790314060e+02,
6838           0.6068463791422e-07, 0.5679713760431e+01, 0.1114304132498e+00,
6839           0.4359361135065e-07, 0.6097219641646e+00, 0.1375773836557e+01,
6840 
6841           0.4686510366826e-07, 0.4786231041431e+01, 0.1143987543936e+00,
6842           0.3758977287225e-07, 0.1167368068139e+01, 0.1596186371003e+01,
6843           0.4282051974778e-07, 0.1519471064319e+01, 0.2770348281756e+00,
6844           0.5153765386113e-07, 0.1860532322984e+01, 0.2228608264996e+00,
6845           0.4575129387188e-07, 0.7632857887158e+00, 0.1465949902372e+00,
6846           0.3326844933286e-07, 0.1298219485285e+01, 0.5070101000000e-01,
6847           0.3748617450984e-07, 0.1046510321062e+01, 0.4903339079539e+00,
6848           0.2816756661499e-07, 0.3434522346190e+01, 0.2991266627620e+00,
6849           0.3412750405039e-07, 0.2523766270318e+01, 0.3518164938661e+00,
6850           0.2655796761776e-07, 0.2904422260194e+01, 0.6256703299991e+00,
6851 
6852           0.2963597929458e-07, 0.5923900431149e+00, 0.1099462426779e+00,
6853           0.2539523734781e-07, 0.4851947722567e+01, 0.1256615170089e+02,
6854           0.2283087914139e-07, 0.3400498595496e+01, 0.6681224869435e+01,
6855           0.2321309799331e-07, 0.5789099148673e+01, 0.3368040641550e-01,
6856           0.2549657649750e-07, 0.3991856479792e-01, 0.1169588211447e+01,
6857           0.2290462303977e-07, 0.2788567577052e+01, 0.1045155034888e+01,
6858           0.1945398522914e-07, 0.3290896998176e+01, 0.1155361302111e+01,
6859           0.1849171512638e-07, 0.2698060129367e+01, 0.4452511715700e-02,
6860           0.1647199834254e-07, 0.3016735644085e+01, 0.4408250688924e+00,
6861           0.1529530765273e-07, 0.5573043116178e+01, 0.6521991896920e-01,
6862 
6863           0.1433199339978e-07, 0.1481192356147e+01, 0.9420622223326e+00,
6864           0.1729134193602e-07, 0.1422817538933e+01, 0.2108507877249e+00,
6865           0.1716463931346e-07, 0.3469468901855e+01, 0.2157473718317e+00,
6866           0.1391206061378e-07, 0.6122436220547e+01, 0.4123712502208e+00,
6867           0.1404746661924e-07, 0.1647765641936e+01, 0.4258542984690e-01,
6868           0.1410452399455e-07, 0.5989729161964e+01, 0.2258291676434e+00,
6869           0.1089828772168e-07, 0.2833705509371e+01, 0.4226656969313e+00,
6870           0.1047374564948e-07, 0.5090690007331e+00, 0.3092784376656e+00,
6871           0.1358279126532e-07, 0.5128990262836e+01, 0.7923417740620e-01,
6872           0.1020456476148e-07, 0.9632772880808e+00, 0.1456308687557e+00,
6873 
6874           0.1033428735328e-07, 0.3223779318418e+01, 0.1795258541446e+01,
6875           0.1412435841540e-07, 0.2410271572721e+01, 0.1525316725248e+00,
6876           0.9722759371574e-08, 0.2333531395690e+01, 0.8434341241180e-01,
6877           0.9657334084704e-08, 0.6199270974168e+01, 0.1272681024002e+01,
6878           0.1083641148690e-07, 0.2864222292929e+01, 0.7032915397480e-01,
6879           0.1067318403838e-07, 0.5833458866568e+00, 0.2123349582968e+00,
6880           0.1062366201976e-07, 0.4307753989494e+01, 0.2142632012598e+00,
6881           0.1236364149266e-07, 0.2873917870593e+01, 0.1847279083684e+00,
6882           0.1092759489593e-07, 0.2959887266733e+01, 0.1370332435159e+00,
6883           0.8912069362899e-08, 0.5141213702562e+01, 0.2648454860559e+01,
6884 
6885           0.9656467707970e-08, 0.4532182462323e+01, 0.4376440768498e+00,
6886           0.8098386150135e-08, 0.2268906338379e+01, 0.2880807454688e+00,
6887           0.7857714675000e-08, 0.4055544260745e+01, 0.2037373330570e+00,
6888           0.7288455940646e-08, 0.5357901655142e+01, 0.1129145838217e+00,
6889           0.9450595950552e-08, 0.4264926963939e+01, 0.5272426800584e+00,
6890           0.9381718247537e-08, 0.7489366976576e-01, 0.5321392641652e+00,
6891           0.7079052646038e-08, 0.1923311052874e+01, 0.6288513220417e+00,
6892           0.9259004415344e-08, 0.2970256853438e+01, 0.1606092486742e+00,
6893           0.8259801499742e-08, 0.3327056314697e+01, 0.8389694097774e+00,
6894           0.6476334355779e-08, 0.2954925505727e+01, 0.2008557621224e+01,
6895 
6896           0.5984021492007e-08, 0.9138753105829e+00, 0.2042657109477e+02,
6897           0.5989546863181e-08, 0.3244464082031e+01, 0.2111650433779e+01,
6898           0.6233108606023e-08, 0.4995232638403e+00, 0.4305306221819e+00,
6899           0.6877299149965e-08, 0.2834987233449e+01, 0.9561746721300e-02,
6900           0.8311234227190e-08, 0.2202951835758e+01, 0.3801276407308e+00,
6901           0.6599472832414e-08, 0.4478581462618e+01, 0.1063314406849e+01,
6902           0.6160491096549e-08, 0.5145858696411e+01, 0.1368660381889e+01,
6903           0.6164772043891e-08, 0.3762976697911e+00, 0.4234171675140e+00,
6904           0.6363248684450e-08, 0.3162246718685e+01, 0.1253008786510e-01,
6905           0.6448587520999e-08, 0.3442693302119e+01, 0.5287268506303e+00,
6906 
6907           0.6431662283977e-08, 0.8977549136606e+00, 0.5306550935933e+00,
6908           0.6351223158474e-08, 0.4306447410369e+01, 0.5217580628120e+02,
6909           0.5476721393451e-08, 0.3888529177855e+01, 0.2221856701002e+01,
6910           0.5341772572619e-08, 0.2655560662512e+01, 0.7466759693650e-01,
6911           0.5337055758302e-08, 0.5164990735946e+01, 0.7489573444450e-01,
6912           0.5373120816787e-08, 0.6041214553456e+01, 0.1274714967946e+00,
6913           0.5392351705426e-08, 0.9177763485932e+00, 0.1055449481598e+01,
6914           0.6688495850205e-08, 0.3089608126937e+01, 0.2213766559277e+00,
6915           0.5072003660362e-08, 0.4311316541553e+01, 0.2132517061319e+00,
6916           0.5070726650455e-08, 0.5790675464444e+00, 0.2133464534247e+00,
6917 
6918           0.5658012950032e-08, 0.2703945510675e+01, 0.7287631425543e+00,
6919           0.4835509924854e-08, 0.2975422976065e+01, 0.7160067364790e-01,
6920           0.6479821978012e-08, 0.1324168733114e+01, 0.2209183458640e-01,
6921           0.6230636494980e-08, 0.2860103632836e+01, 0.3306188016693e+00,
6922           0.4649239516213e-08, 0.4832259763403e+01, 0.7796265773310e-01,
6923           0.6487325792700e-08, 0.2726165825042e+01, 0.3884652414254e+00,
6924           0.4682823682770e-08, 0.6966602455408e+00, 0.1073608853559e+01,
6925           0.5704230804976e-08, 0.5669634104606e+01, 0.8731175355560e-01,
6926           0.6125413585489e-08, 0.1513386538915e+01, 0.7605151500000e-01,
6927           0.6035825038187e-08, 0.1983509168227e+01, 0.9846002785331e+00,
6928 
6929           0.4331123462303e-08, 0.2782892992807e+01, 0.4297791515992e+00,
6930           0.4681107685143e-08, 0.5337232886836e+01, 0.2127790306879e+00,
6931           0.4669105829655e-08, 0.5837133792160e+01, 0.2138191288687e+00,
6932           0.5138823602365e-08, 0.3080560200507e+01, 0.7233337363710e-01,
6933           0.4615856664534e-08, 0.1661747897471e+01, 0.8603097737811e+00,
6934           0.4496916702197e-08, 0.2112508027068e+01, 0.7381754420900e-01,
6935           0.4278479042945e-08, 0.5716528462627e+01, 0.7574578717200e-01,
6936           0.3840525503932e-08, 0.6424172726492e+00, 0.3407705765729e+00,
6937           0.4866636509685e-08, 0.4919244697715e+01, 0.7722995774390e-01,
6938           0.3526100639296e-08, 0.2550821052734e+01, 0.6225157782540e-01,
6939 
6940           0.3939558488075e-08, 0.3939331491710e+01, 0.5268983110410e-01,
6941           0.4041268772576e-08, 0.2275337571218e+01, 0.3503323232942e+00,
6942           0.3948761842853e-08, 0.1999324200790e+01, 0.1451108196653e+00,
6943           0.3258394550029e-08, 0.9121001378200e+00, 0.5296435984654e+00,
6944           0.3257897048761e-08, 0.3428428660869e+01, 0.5297383457582e+00,
6945           0.3842559031298e-08, 0.6132927720035e+01, 0.9098186128426e+00,
6946           0.3109920095448e-08, 0.7693650193003e+00, 0.3932462625300e-02,
6947           0.3132237775119e-08, 0.3621293854908e+01, 0.2346394437820e+00,
6948           0.3942189421510e-08, 0.4841863659733e+01, 0.3180992042600e-02,
6949           0.3796972285340e-08, 0.1814174994268e+01, 0.1862120789403e+00,
6950 
6951           0.3995640233688e-08, 0.1386990406091e+01, 0.4549093064213e+00,
6952           0.2875013727414e-08, 0.9178318587177e+00, 0.1905464808669e+01,
6953           0.3073719932844e-08, 0.2688923811835e+01, 0.3628624111593e+00,
6954           0.2731016580075e-08, 0.1188259127584e+01, 0.2131850110243e+00,
6955           0.2729549896546e-08, 0.3702160634273e+01, 0.2134131485323e+00,
6956           0.3339372892449e-08, 0.7199163960331e+00, 0.2007689919132e+00,
6957           0.2898833764204e-08, 0.1916709364999e+01, 0.5291709230214e+00,
6958           0.2894536549362e-08, 0.2424043195547e+01, 0.5302110212022e+00,
6959           0.3096872473843e-08, 0.4445894977497e+01, 0.2976424921901e+00,
6960           0.2635672326810e-08, 0.3814366984117e+01, 0.1485980103780e+01,
6961 
6962           0.3649302697001e-08, 0.2924200596084e+01, 0.6044726378023e+00,
6963           0.3127954585895e-08, 0.1842251648327e+01, 0.1084620721060e+00,
6964           0.2616040173947e-08, 0.4155841921984e+01, 0.1258454114666e+01,
6965           0.2597395859860e-08, 0.1158045978874e+00, 0.2103781122809e+00,
6966           0.2593286172210e-08, 0.4771850408691e+01, 0.2162200472757e+00,
6967           0.2481823585747e-08, 0.4608842558889e+00, 0.1062562936266e+01,
6968           0.2742219550725e-08, 0.1538781127028e+01, 0.5651155736444e+00,
6969           0.3199558469610e-08, 0.3226647822878e+00, 0.7036329877322e+00,
6970           0.2666088542957e-08, 0.1967991731219e+00, 0.1400015846597e+00,
6971           0.2397067430580e-08, 0.3707036669873e+01, 0.2125476091956e+00,
6972 
6973           0.2376570772738e-08, 0.1182086628042e+01, 0.2140505503610e+00,
6974           0.2547228007887e-08, 0.4906256820629e+01, 0.1534957940063e+00,
6975           0.2265575594114e-08, 0.3414949866857e+01, 0.2235935264888e+00,
6976           0.2464381430585e-08, 0.4599122275378e+01, 0.2091065926078e+00,
6977           0.2433408527044e-08, 0.2830751145445e+00, 0.2174915669488e+00,
6978           0.2443605509076e-08, 0.4212046432538e+01, 0.1739420156204e+00,
6979           0.2319779262465e-08, 0.9881978408630e+00, 0.7530171478090e-01,
6980           0.2284622835465e-08, 0.5565347331588e+00, 0.7426161660010e-01,
6981           0.2467268750783e-08, 0.5655708150766e+00, 0.2526561439362e+00,
6982           0.2808513492782e-08, 0.1418405053408e+01, 0.5636314030725e+00,
6983 
6984           0.2329528932532e-08, 0.4069557545675e+01, 0.1056200952181e+01,
6985           0.9698639532817e-09, 0.1074134313634e+01, 0.7826370942180e+02 };
6986 
6987     /* SSB-to-Sun, T^0, Y */
6988       static final double s0y[] = {
6989           0.4955392320126e-02, 0.2170467313679e+01, 0.5296909721118e+00,
6990           0.2722325167392e-02, 0.2444433682196e+01, 0.2132990797783e+00,
6991           0.1546579925346e-02, 0.5992779281546e+00, 0.3813291813120e-01,
6992           0.8363140252966e-03, 0.7687356310801e+00, 0.7478166569050e-01,
6993           0.3385792683603e-03, 0.0000000000000e+00, 0.0000000000000e+00,
6994           0.1201192221613e-03, 0.2520035601514e+01, 0.1059381944224e+01,
6995           0.7587125720554e-04, 0.1669954006449e+01, 0.4265981595566e+00,
6996           0.1964155361250e-04, 0.5707743963343e+01, 0.2061856251104e+00,
6997           0.1891900364909e-04, 0.2320960679937e+01, 0.2204125344462e+00,
6998           0.1937373433356e-04, 0.3226940689555e+01, 0.1495633313810e+00,
6999 
7000           0.1437139941351e-04, 0.2301626908096e+01, 0.5225775174439e+00,
7001           0.1406267683099e-04, 0.5188579265542e+01, 0.5368044267797e+00,
7002           0.1178703080346e-04, 0.5489483248476e+01, 0.7626583626240e-01,
7003           0.8079835186041e-05, 0.1683751835264e+01, 0.3664874755930e-01,
7004           0.7623253594652e-05, 0.2656400462961e+01, 0.3961708870310e-01,
7005           0.6248667483971e-05, 0.4992775362055e+01, 0.7329749511860e-01,
7006           0.4366353695038e-05, 0.2869706279678e+01, 0.1589072916335e+01,
7007           0.3829101568895e-05, 0.3572131359950e+01, 0.7113454667900e-02,
7008           0.3175733773908e-05, 0.4535372530045e+01, 0.4194847048887e+00,
7009           0.3092437902159e-05, 0.9230153317909e+00, 0.6398972393349e+00,
7010 
7011           0.2874168812154e-05, 0.3363143761101e+01, 0.1102062672231e+00,
7012           0.3040119321826e-05, 0.3324250895675e+01, 0.6283075850446e+01,
7013           0.2699723308006e-05, 0.2917882441928e+00, 0.1030928125552e+00,
7014           0.2134832683534e-05, 0.4220997202487e+01, 0.3163918923335e+00,
7015           0.1770412139433e-05, 0.4747318496462e+01, 0.1021328554739e+02,
7016           0.1377264209373e-05, 0.4305058462401e+00, 0.1484170571900e-02,
7017           0.1127814538960e-05, 0.8538177240740e+00, 0.6327837846670e+00,
7018           0.1055608090130e-05, 0.1551800742580e+01, 0.4337116142245e+00,
7019           0.9802673861420e-06, 0.1459646735377e+01, 0.1052268489556e+01,
7020           0.1090329461951e-05, 0.1587351228711e+01, 0.1162474756779e+01,
7021 
7022           0.6959590025090e-06, 0.5534442628766e+01, 0.1066495398892e+01,
7023           0.5664914529542e-06, 0.6030673003297e+01, 0.9491756770005e+00,
7024           0.6607787763599e-06, 0.4989507233927e+01, 0.8460828644453e+00,
7025           0.6269725742838e-06, 0.4222951804572e+01, 0.1480791608091e+00,
7026           0.6301889697863e-06, 0.5444316669126e+01, 0.2243449970715e+00,
7027           0.4891042662861e-06, 0.1490552839784e+01, 0.3340612434717e+01,
7028           0.3457083123290e-06, 0.3030475486049e+01, 0.3516457698740e-01,
7029           0.3032559967314e-06, 0.2652038793632e+01, 0.1104591729320e-01,
7030           0.2841133988903e-06, 0.1276744786829e+01, 0.4110125927500e-01,
7031           0.2855564444432e-06, 0.2143368674733e+01, 0.1510475019529e+00,
7032 
7033           0.2765157135038e-06, 0.5444186109077e+01, 0.6373574839730e-01,
7034           0.2382312465034e-06, 0.2190521137593e+01, 0.2275259891141e+00,
7035           0.2808060365077e-06, 0.5735195064841e+01, 0.2535050500000e-01,
7036           0.2332175234405e-06, 0.9481985524859e-01, 0.7181332454670e-01,
7037           0.2322488199659e-06, 0.5180499361533e+01, 0.8582758298370e-01,
7038           0.1881850258423e-06, 0.3219788273885e+01, 0.2118763888447e+01,
7039           0.2196111392808e-06, 0.2366941159761e+01, 0.2968341143800e-02,
7040           0.2183810335519e-06, 0.4825445110915e+01, 0.7775000683430e-01,
7041           0.2002733093326e-06, 0.2457148995307e+01, 0.2093666171530e+00,
7042           0.1967111767229e-06, 0.5586291545459e+01, 0.2172315424036e+00,
7043 
7044           0.1568473250543e-06, 0.3708003123320e+01, 0.7429900518901e+00,
7045           0.1852528314300e-06, 0.4310638151560e+01, 0.2022531624851e+00,
7046           0.1832111226447e-06, 0.1494665322656e+01, 0.3235053470014e+00,
7047           0.1746805502310e-06, 0.1451378500784e+01, 0.1385174140878e+00,
7048           0.1555730966650e-06, 0.1068040418198e+01, 0.7358765972222e+00,
7049           0.1554883462559e-06, 0.2442579035461e+01, 0.5154640627760e+00,
7050           0.1638380568746e-06, 0.2597913420625e+00, 0.8531963191132e+00,
7051           0.1159938593640e-06, 0.5834512021280e+01, 0.1990721704425e+00,
7052           0.1083427965695e-06, 0.5054033177950e+01, 0.5439178814476e+00,
7053           0.1156480369431e-06, 0.5325677432457e+01, 0.5257585094865e+00,
7054 
7055           0.1141308860095e-06, 0.2153403923857e+01, 0.5336234347371e+00,
7056           0.7913146470946e-07, 0.8642846847027e+00, 0.1478866649112e+01,
7057           0.7439752463733e-07, 0.1970628496213e+01, 0.2164800718209e+00,
7058           0.7280277104079e-07, 0.6073307250609e+01, 0.2101180877357e+00,
7059           0.8319567719136e-07, 0.1954371928334e+01, 0.1692165728891e+01,
7060           0.7137705549290e-07, 0.8904989440909e+00, 0.4155522422634e+00,
7061           0.6900825396225e-07, 0.2825717714977e+01, 0.1173197218910e+00,
7062           0.7245757216635e-07, 0.2481677513331e+01, 0.1265567569334e+01,
7063           0.6961165696255e-07, 0.1292955312978e+01, 0.9562891316684e+00,
7064           0.7571804456890e-07, 0.3427517575069e+01, 0.1422690933580e-01,
7065 
7066           0.6605425721904e-07, 0.8052192701492e+00, 0.6470106940028e+00,
7067           0.7375477357248e-07, 0.1705076390088e+01, 0.1581959461667e+01,
7068           0.7041664951470e-07, 0.4848356967891e+00, 0.9597935788730e-01,
7069           0.6322199535763e-07, 0.3878069473909e+01, 0.7084920306520e-01,
7070           0.5244380279191e-07, 0.2645560544125e+01, 0.5265099800692e+00,
7071           0.5143125704988e-07, 0.4834486101370e+01, 0.5328719641544e+00,
7072           0.5871866319373e-07, 0.7981472548900e+00, 0.7871412831580e-01,
7073           0.6300822573871e-07, 0.5979398788281e+01, 0.2608790314060e+02,
7074           0.6062154271548e-07, 0.4108655402756e+01, 0.1114304132498e+00,
7075           0.4361912339976e-07, 0.5322624319280e+01, 0.1375773836557e+01,
7076 
7077           0.4417005920067e-07, 0.6240817359284e+01, 0.2770348281756e+00,
7078           0.4686806749936e-07, 0.3214977301156e+01, 0.1143987543936e+00,
7079           0.3758892132305e-07, 0.5879809634765e+01, 0.1596186371003e+01,
7080           0.5151351332319e-07, 0.2893377688007e+00, 0.2228608264996e+00,
7081           0.4554683578572e-07, 0.5475427144122e+01, 0.1465949902372e+00,
7082           0.3442381385338e-07, 0.5992034796640e+01, 0.5070101000000e-01,
7083           0.2831093954933e-07, 0.5367350273914e+01, 0.3092784376656e+00,
7084           0.3756267090084e-07, 0.5758171285420e+01, 0.4903339079539e+00,
7085           0.2816374679892e-07, 0.1863718700923e+01, 0.2991266627620e+00,
7086           0.3419307025569e-07, 0.9524347534130e+00, 0.3518164938661e+00,
7087 
7088           0.2904250494239e-07, 0.5304471615602e+01, 0.1099462426779e+00,
7089           0.2471734511206e-07, 0.1297069793530e+01, 0.6256703299991e+00,
7090           0.2539620831872e-07, 0.3281126083375e+01, 0.1256615170089e+02,
7091           0.2281017868007e-07, 0.1829122133165e+01, 0.6681224869435e+01,
7092           0.2275319473335e-07, 0.5797198160181e+01, 0.3932462625300e-02,
7093           0.2547755368442e-07, 0.4752697708330e+01, 0.1169588211447e+01,
7094           0.2285979669317e-07, 0.1223205292886e+01, 0.1045155034888e+01,
7095           0.1913386560994e-07, 0.1757532993389e+01, 0.1155361302111e+01,
7096           0.1809020525147e-07, 0.4246116108791e+01, 0.3368040641550e-01,
7097           0.1649213300201e-07, 0.1445162890627e+01, 0.4408250688924e+00,
7098 
7099           0.1834972793932e-07, 0.1126917567225e+01, 0.4452511715700e-02,
7100           0.1439550648138e-07, 0.6160756834764e+01, 0.9420622223326e+00,
7101           0.1487645457041e-07, 0.4358761931792e+01, 0.4123712502208e+00,
7102           0.1731729516660e-07, 0.6134456753344e+01, 0.2108507877249e+00,
7103           0.1717747163567e-07, 0.1898186084455e+01, 0.2157473718317e+00,
7104           0.1418190430374e-07, 0.4180286741266e+01, 0.6521991896920e-01,
7105           0.1404844134873e-07, 0.7654053565412e-01, 0.4258542984690e-01,
7106           0.1409842846538e-07, 0.4418612420312e+01, 0.2258291676434e+00,
7107           0.1090948346291e-07, 0.1260615686131e+01, 0.4226656969313e+00,
7108           0.1357577323612e-07, 0.3558248818690e+01, 0.7923417740620e-01,
7109 
7110           0.1018154061960e-07, 0.5676087241256e+01, 0.1456308687557e+00,
7111           0.1412073972109e-07, 0.8394392632422e+00, 0.1525316725248e+00,
7112           0.1030938326496e-07, 0.1653593274064e+01, 0.1795258541446e+01,
7113           0.1180081567104e-07, 0.1285802592036e+01, 0.7032915397480e-01,
7114           0.9708510575650e-08, 0.7631889488106e+00, 0.8434341241180e-01,
7115           0.9637689663447e-08, 0.4630642649176e+01, 0.1272681024002e+01,
7116           0.1068910429389e-07, 0.5294934032165e+01, 0.2123349582968e+00,
7117           0.1063716179336e-07, 0.2736266800832e+01, 0.2142632012598e+00,
7118           0.1234858713814e-07, 0.1302891146570e+01, 0.1847279083684e+00,
7119           0.8912631189738e-08, 0.3570415993621e+01, 0.2648454860559e+01,
7120 
7121           0.1036378285534e-07, 0.4236693440949e+01, 0.1370332435159e+00,
7122           0.9667798501561e-08, 0.2960768892398e+01, 0.4376440768498e+00,
7123           0.8108314201902e-08, 0.6987781646841e+00, 0.2880807454688e+00,
7124           0.7648364324628e-08, 0.2499017863863e+01, 0.2037373330570e+00,
7125           0.7286136828406e-08, 0.3787426951665e+01, 0.1129145838217e+00,
7126           0.9448237743913e-08, 0.2694354332983e+01, 0.5272426800584e+00,
7127           0.9374276106428e-08, 0.4787121277064e+01, 0.5321392641652e+00,
7128           0.7100226287462e-08, 0.3530238792101e+00, 0.6288513220417e+00,
7129           0.9253056659571e-08, 0.1399478925664e+01, 0.1606092486742e+00,
7130           0.6636432145504e-08, 0.3479575438447e+01, 0.1368660381889e+01,
7131 
7132           0.6469975312932e-08, 0.1383669964800e+01, 0.2008557621224e+01,
7133           0.7335849729765e-08, 0.1243698166898e+01, 0.9561746721300e-02,
7134           0.8743421205855e-08, 0.3776164289301e+01, 0.3801276407308e+00,
7135           0.5993635744494e-08, 0.5627122113596e+01, 0.2042657109477e+02,
7136           0.5981008479693e-08, 0.1674336636752e+01, 0.2111650433779e+01,
7137           0.6188535145838e-08, 0.5214925208672e+01, 0.4305306221819e+00,
7138           0.6596074017566e-08, 0.2907653268124e+01, 0.1063314406849e+01,
7139           0.6630815126226e-08, 0.2127643669658e+01, 0.8389694097774e+00,
7140           0.6156772830040e-08, 0.5082160803295e+01, 0.4234171675140e+00,
7141           0.6446960563014e-08, 0.1872100916905e+01, 0.5287268506303e+00,
7142 
7143           0.6429324424668e-08, 0.5610276103577e+01, 0.5306550935933e+00,
7144           0.6302232396465e-08, 0.1592152049607e+01, 0.1253008786510e-01,
7145           0.6399244436159e-08, 0.2746214421532e+01, 0.5217580628120e+02,
7146           0.5474965172558e-08, 0.2317666374383e+01, 0.2221856701002e+01,
7147           0.5339293190692e-08, 0.1084724961156e+01, 0.7466759693650e-01,
7148           0.5334733683389e-08, 0.3594106067745e+01, 0.7489573444450e-01,
7149           0.5392665782110e-08, 0.5630254365606e+01, 0.1055449481598e+01,
7150           0.6682075673789e-08, 0.1518480041732e+01, 0.2213766559277e+00,
7151           0.5079130495960e-08, 0.2739765115711e+01, 0.2132517061319e+00,
7152           0.5077759793261e-08, 0.5290711290094e+01, 0.2133464534247e+00,
7153 
7154           0.4832037368310e-08, 0.1404473217200e+01, 0.7160067364790e-01,
7155           0.6463279674802e-08, 0.6038381695210e+01, 0.2209183458640e-01,
7156           0.6240592771560e-08, 0.1290170653666e+01, 0.3306188016693e+00,
7157           0.4672013521493e-08, 0.3261895939677e+01, 0.7796265773310e-01,
7158           0.6500650750348e-08, 0.1154522312095e+01, 0.3884652414254e+00,
7159           0.6344161389053e-08, 0.6206111545062e+01, 0.7605151500000e-01,
7160           0.4682518370646e-08, 0.5409118796685e+01, 0.1073608853559e+01,
7161           0.5329460015591e-08, 0.1202985784864e+01, 0.7287631425543e+00,
7162           0.5701588675898e-08, 0.4098715257064e+01, 0.8731175355560e-01,
7163           0.6030690867211e-08, 0.4132033218460e+00, 0.9846002785331e+00,
7164 
7165           0.4336256312655e-08, 0.1211415991827e+01, 0.4297791515992e+00,
7166           0.4688498808975e-08, 0.3765479072409e+01, 0.2127790306879e+00,
7167           0.4675578609335e-08, 0.4265540037226e+01, 0.2138191288687e+00,
7168           0.4225578112158e-08, 0.5237566010676e+01, 0.3407705765729e+00,
7169           0.5139422230028e-08, 0.1507173079513e+01, 0.7233337363710e-01,
7170           0.4619995093571e-08, 0.9023957449848e-01, 0.8603097737811e+00,
7171           0.4494776255461e-08, 0.5414930552139e+00, 0.7381754420900e-01,
7172           0.4274026276788e-08, 0.4145735303659e+01, 0.7574578717200e-01,
7173           0.5018141789353e-08, 0.3344408829055e+01, 0.3180992042600e-02,
7174           0.4866163952181e-08, 0.3348534657607e+01, 0.7722995774390e-01,
7175 
7176           0.4111986020501e-08, 0.4198823597220e+00, 0.1451108196653e+00,
7177           0.3356142784950e-08, 0.5609144747180e+01, 0.1274714967946e+00,
7178           0.4070575554551e-08, 0.7028411059224e+00, 0.3503323232942e+00,
7179           0.3257451857278e-08, 0.5624697983086e+01, 0.5296435984654e+00,
7180           0.3256973703026e-08, 0.1857842076707e+01, 0.5297383457582e+00,
7181           0.3830771508640e-08, 0.4562887279931e+01, 0.9098186128426e+00,
7182           0.3725024005962e-08, 0.2358058692652e+00, 0.1084620721060e+00,
7183           0.3136763921756e-08, 0.2049731526845e+01, 0.2346394437820e+00,
7184           0.3795147256194e-08, 0.2432356296933e+00, 0.1862120789403e+00,
7185           0.2877342229911e-08, 0.5631101279387e+01, 0.1905464808669e+01,
7186 
7187           0.3076931798805e-08, 0.1117615737392e+01, 0.3628624111593e+00,
7188           0.2734765945273e-08, 0.5899826516955e+01, 0.2131850110243e+00,
7189           0.2733405296885e-08, 0.2130562964070e+01, 0.2134131485323e+00,
7190           0.2898552353410e-08, 0.3462387048225e+00, 0.5291709230214e+00,
7191           0.2893736103681e-08, 0.8534352781543e+00, 0.5302110212022e+00,
7192           0.3095717734137e-08, 0.2875061429041e+01, 0.2976424921901e+00,
7193           0.2636190425832e-08, 0.2242512846659e+01, 0.1485980103780e+01,
7194           0.3645512095537e-08, 0.1354016903958e+01, 0.6044726378023e+00,
7195           0.2808173547723e-08, 0.6705114365631e-01, 0.6225157782540e-01,
7196           0.2625012866888e-08, 0.4775705748482e+01, 0.5268983110410e-01,
7197 
7198           0.2572233995651e-08, 0.2638924216139e+01, 0.1258454114666e+01,
7199           0.2604238824792e-08, 0.4826358927373e+01, 0.2103781122809e+00,
7200           0.2596886385239e-08, 0.3200388483118e+01, 0.2162200472757e+00,
7201           0.3228057304264e-08, 0.5384848409563e+01, 0.2007689919132e+00,
7202           0.2481601798252e-08, 0.5173373487744e+01, 0.1062562936266e+01,
7203           0.2745977498864e-08, 0.6250966149853e+01, 0.5651155736444e+00,
7204           0.2669878833811e-08, 0.4906001352499e+01, 0.1400015846597e+00,
7205           0.3203986611711e-08, 0.5034333010005e+01, 0.7036329877322e+00,
7206           0.3354961227212e-08, 0.6108262423137e+01, 0.4549093064213e+00,
7207           0.2400407324558e-08, 0.2135399294955e+01, 0.2125476091956e+00,
7208 
7209           0.2379905859802e-08, 0.5893721933961e+01, 0.2140505503610e+00,
7210           0.2550844302187e-08, 0.3331940762063e+01, 0.1534957940063e+00,
7211           0.2268824211001e-08, 0.1843418461035e+01, 0.2235935264888e+00,
7212           0.2464700891204e-08, 0.3029548547230e+01, 0.2091065926078e+00,
7213           0.2436814726024e-08, 0.4994717970364e+01, 0.2174915669488e+00,
7214           0.2443623894745e-08, 0.2645102591375e+01, 0.1739420156204e+00,
7215           0.2318701783838e-08, 0.5700547397897e+01, 0.7530171478090e-01,
7216           0.2284448700256e-08, 0.5268898905872e+01, 0.7426161660010e-01,
7217           0.2468848123510e-08, 0.5276280575078e+01, 0.2526561439362e+00,
7218           0.2814052350303e-08, 0.6130168623475e+01, 0.5636314030725e+00,
7219 
7220           0.2243662755220e-08, 0.6631692457995e+00, 0.8886590321940e-01,
7221           0.2330795855941e-08, 0.2499435487702e+01, 0.1056200952181e+01,
7222           0.9757679038404e-09, 0.5796846023126e+01, 0.7826370942180e+02 };
7223 
7224     /* SSB-to-Sun, T^0, Z */
7225       static  final double s0z[] = {
7226           0.1181255122986e-03, 0.4607918989164e+00, 0.2132990797783e+00,
7227           0.1127777651095e-03, 0.4169146331296e+00, 0.5296909721118e+00,
7228           0.4777754401806e-04, 0.4582657007130e+01, 0.3813291813120e-01,
7229           0.1129354285772e-04, 0.5758735142480e+01, 0.7478166569050e-01,
7230          -0.1149543637123e-04, 0.0000000000000e+00, 0.0000000000000e+00,
7231           0.3298730512306e-05, 0.5978801994625e+01, 0.4265981595566e+00,
7232           0.2733376706079e-05, 0.7665413691040e+00, 0.1059381944224e+01,
7233           0.9426389657270e-06, 0.3710201265838e+01, 0.2061856251104e+00,
7234           0.8187517749552e-06, 0.3390675605802e+00, 0.2204125344462e+00,
7235           0.4080447871819e-06, 0.4552296640088e+00, 0.5225775174439e+00,
7236 
7237           0.3169973017028e-06, 0.3445455899321e+01, 0.5368044267797e+00,
7238           0.2438098615549e-06, 0.5664675150648e+01, 0.3664874755930e-01,
7239           0.2601897517235e-06, 0.1931894095697e+01, 0.1495633313810e+00,
7240           0.2314558080079e-06, 0.3666319115574e+00, 0.3961708870310e-01,
7241           0.1962549548002e-06, 0.3167411699020e+01, 0.7626583626240e-01,
7242           0.2180518287925e-06, 0.1544420746580e+01, 0.7113454667900e-02,
7243           0.1451382442868e-06, 0.1583756740070e+01, 0.1102062672231e+00,
7244           0.1358439007389e-06, 0.5239941758280e+01, 0.6398972393349e+00,
7245           0.1050585898028e-06, 0.2266958352859e+01, 0.3163918923335e+00,
7246           0.1050029870186e-06, 0.2711495250354e+01, 0.4194847048887e+00,
7247 
7248           0.9934920679800e-07, 0.1116208151396e+01, 0.1589072916335e+01,
7249           0.1048395331560e-06, 0.3408619600206e+01, 0.1021328554739e+02,
7250           0.8370147196668e-07, 0.3810459401087e+01, 0.2535050500000e-01,
7251           0.7989856510998e-07, 0.3769910473647e+01, 0.7329749511860e-01,
7252           0.5441221655233e-07, 0.2416994903374e+01, 0.1030928125552e+00,
7253           0.4610812906784e-07, 0.5858503336994e+01, 0.4337116142245e+00,
7254           0.3923022803444e-07, 0.3354170010125e+00, 0.1484170571900e-02,
7255           0.2610725582128e-07, 0.5410600646324e+01, 0.6327837846670e+00,
7256           0.2455279767721e-07, 0.6120216681403e+01, 0.1162474756779e+01,
7257           0.2375530706525e-07, 0.6055443426143e+01, 0.1052268489556e+01,
7258 
7259           0.1782967577553e-07, 0.3146108708004e+01, 0.8460828644453e+00,
7260           0.1581687095238e-07, 0.6255496089819e+00, 0.3340612434717e+01,
7261           0.1594657672461e-07, 0.3782604300261e+01, 0.1066495398892e+01,
7262           0.1563448615040e-07, 0.1997775733196e+01, 0.2022531624851e+00,
7263           0.1463624258525e-07, 0.1736316792088e+00, 0.3516457698740e-01,
7264           0.1331585056673e-07, 0.4331941830747e+01, 0.9491756770005e+00,
7265           0.1130634557637e-07, 0.6152017751825e+01, 0.2968341143800e-02,
7266           0.1028949607145e-07, 0.2101792614637e+00, 0.2275259891141e+00,
7267           0.1024074971618e-07, 0.4071833211074e+01, 0.5070101000000e-01,
7268           0.8826956060303e-08, 0.4861633688145e+00, 0.2093666171530e+00,
7269 
7270           0.8572230171541e-08, 0.5268190724302e+01, 0.4110125927500e-01,
7271           0.7649332643544e-08, 0.5134543417106e+01, 0.2608790314060e+02,
7272           0.8581673291033e-08, 0.2920218146681e+01, 0.1480791608091e+00,
7273           0.8430589300938e-08, 0.3604576619108e+01, 0.2172315424036e+00,
7274           0.7776165501012e-08, 0.3772942249792e+01, 0.6373574839730e-01,
7275           0.8311070234408e-08, 0.6200412329888e+01, 0.3235053470014e+00,
7276           0.6927365212582e-08, 0.4543353113437e+01, 0.8531963191132e+00,
7277           0.6791574208598e-08, 0.2882188406238e+01, 0.7181332454670e-01,
7278           0.5593100811839e-08, 0.1776646892780e+01, 0.7429900518901e+00,
7279           0.4553381853021e-08, 0.3949617611240e+01, 0.7775000683430e-01,
7280 
7281           0.5758000450068e-08, 0.3859251775075e+01, 0.1990721704425e+00,
7282           0.4281283457133e-08, 0.1466294631206e+01, 0.2118763888447e+01,
7283           0.4206935661097e-08, 0.5421776011706e+01, 0.1104591729320e-01,
7284           0.4213751641837e-08, 0.3412048993322e+01, 0.2243449970715e+00,
7285           0.5310506239878e-08, 0.5421641370995e+00, 0.5154640627760e+00,
7286           0.3827450341320e-08, 0.8887314524995e+00, 0.1510475019529e+00,
7287           0.4292435241187e-08, 0.1405043757194e+01, 0.1422690933580e-01,
7288           0.3189780702289e-08, 0.1060049293445e+01, 0.1173197218910e+00,
7289           0.3226611928069e-08, 0.6270858897442e+01, 0.2164800718209e+00,
7290           0.2893897608830e-08, 0.5117563223301e+01, 0.6470106940028e+00,
7291 
7292           0.3239852024578e-08, 0.4079092237983e+01, 0.2101180877357e+00,
7293           0.2956892222200e-08, 0.1594917021704e+01, 0.3092784376656e+00,
7294           0.2980177912437e-08, 0.5258787667564e+01, 0.4155522422634e+00,
7295           0.3163725690776e-08, 0.3854589225479e+01, 0.8582758298370e-01,
7296           0.2662262399118e-08, 0.3561326430187e+01, 0.5257585094865e+00,
7297           0.2766689135729e-08, 0.3180732086830e+00, 0.1385174140878e+00,
7298           0.2411600278464e-08, 0.3324798335058e+01, 0.5439178814476e+00,
7299           0.2483527695131e-08, 0.4169069291947e+00, 0.5336234347371e+00,
7300           0.7788777276590e-09, 0.1900569908215e+01, 0.5217580628120e+02 };
7301 
7302     /* SSB-to-Sun, T^1, X */
7303       static  final double s1x[] = {
7304          -0.1296310361520e-07, 0.0000000000000e+00, 0.0000000000000e+00,
7305           0.8975769009438e-08, 0.1128891609250e+01, 0.4265981595566e+00,
7306           0.7771113441307e-08, 0.2706039877077e+01, 0.2061856251104e+00,
7307           0.7538303866642e-08, 0.2191281289498e+01, 0.2204125344462e+00,
7308           0.6061384579336e-08, 0.3248167319958e+01, 0.1059381944224e+01,
7309           0.5726994235594e-08, 0.5569981398610e+01, 0.5225775174439e+00,
7310           0.5616492836424e-08, 0.5057386614909e+01, 0.5368044267797e+00,
7311           0.1010881584769e-08, 0.3473577116095e+01, 0.7113454667900e-02,
7312           0.7259606157626e-09, 0.3651858593665e+00, 0.6398972393349e+00,
7313           0.8755095026935e-09, 0.1662835408338e+01, 0.4194847048887e+00,
7314 
7315           0.5370491182812e-09, 0.1327673878077e+01, 0.4337116142245e+00,
7316           0.5743773887665e-09, 0.4250200846687e+01, 0.2132990797783e+00,
7317           0.4408103140300e-09, 0.3598752574277e+01, 0.1589072916335e+01,
7318           0.3101892374445e-09, 0.4887822983319e+01, 0.1052268489556e+01,
7319           0.3209453713578e-09, 0.9702272295114e+00, 0.5296909721118e+00,
7320           0.3017228286064e-09, 0.5484462275949e+01, 0.1066495398892e+01,
7321           0.3200700038601e-09, 0.2846613338643e+01, 0.1495633313810e+00,
7322           0.2137637279911e-09, 0.5692163292729e+00, 0.3163918923335e+00,
7323           0.1899686386727e-09, 0.2061077157189e+01, 0.2275259891141e+00,
7324           0.1401994545308e-09, 0.4177771136967e+01, 0.1102062672231e+00,
7325 
7326           0.1578057810499e-09, 0.5782460597335e+01, 0.7626583626240e-01,
7327           0.1237713253351e-09, 0.5705900866881e+01, 0.5154640627760e+00,
7328           0.1313076837395e-09, 0.5163438179576e+01, 0.3664874755930e-01,
7329           0.1184963304860e-09, 0.3054804427242e+01, 0.6327837846670e+00,
7330           0.1238130878565e-09, 0.2317292575962e+01, 0.3961708870310e-01,
7331           0.1015959527736e-09, 0.2194643645526e+01, 0.7329749511860e-01,
7332           0.9017954423714e-10, 0.2868603545435e+01, 0.1990721704425e+00,
7333           0.8668024955603e-10, 0.4923849675082e+01, 0.5439178814476e+00,
7334           0.7756083930103e-10, 0.3014334135200e+01, 0.9491756770005e+00,
7335           0.7536503401741e-10, 0.2704886279769e+01, 0.1030928125552e+00,
7336 
7337           0.5483308679332e-10, 0.6010983673799e+01, 0.8531963191132e+00,
7338           0.5184339620428e-10, 0.1952704573291e+01, 0.2093666171530e+00,
7339           0.5108658712030e-10, 0.2958575786649e+01, 0.2172315424036e+00,
7340           0.5019424524650e-10, 0.1736317621318e+01, 0.2164800718209e+00,
7341           0.4909312625978e-10, 0.3167216416257e+01, 0.2101180877357e+00,
7342           0.4456638901107e-10, 0.7697579923471e+00, 0.3235053470014e+00,
7343           0.4227030350925e-10, 0.3490910137928e+01, 0.6373574839730e-01,
7344           0.4095456040093e-10, 0.5178888984491e+00, 0.6470106940028e+00,
7345           0.4990537041422e-10, 0.3323887668974e+01, 0.1422690933580e-01,
7346           0.4321170010845e-10, 0.4288484987118e+01, 0.7358765972222e+00,
7347 
7348           0.3544072091802e-10, 0.6021051579251e+01, 0.5265099800692e+00,
7349           0.3480198638687e-10, 0.4600027054714e+01, 0.5328719641544e+00,
7350           0.3440287244435e-10, 0.4349525970742e+01, 0.8582758298370e-01,
7351           0.3330628322713e-10, 0.2347391505082e+01, 0.1104591729320e-01,
7352           0.2973060707184e-10, 0.4789409286400e+01, 0.5257585094865e+00,
7353           0.2932606766089e-10, 0.5831693799927e+01, 0.5336234347371e+00,
7354           0.2876972310953e-10, 0.2692638514771e+01, 0.1173197218910e+00,
7355           0.2827488278556e-10, 0.2056052487960e+01, 0.2022531624851e+00,
7356           0.2515028239756e-10, 0.7411863262449e+00, 0.9597935788730e-01,
7357           0.2853033744415e-10, 0.3948481024894e+01, 0.2118763888447e+01 };
7358 
7359     /* SSB-to-Sun, T^1, Y */
7360       static  final double s1y[] = {
7361           0.8989047573576e-08, 0.5840593672122e+01, 0.4265981595566e+00,
7362           0.7815938401048e-08, 0.1129664707133e+01, 0.2061856251104e+00,
7363           0.7550926713280e-08, 0.6196589104845e+00, 0.2204125344462e+00,
7364           0.6056556925895e-08, 0.1677494667846e+01, 0.1059381944224e+01,
7365           0.5734142698204e-08, 0.4000920852962e+01, 0.5225775174439e+00,
7366           0.5614341822459e-08, 0.3486722577328e+01, 0.5368044267797e+00,
7367           0.1028678147656e-08, 0.1877141024787e+01, 0.7113454667900e-02,
7368           0.7270792075266e-09, 0.5077167301739e+01, 0.6398972393349e+00,
7369           0.8734141726040e-09, 0.9069550282609e-01, 0.4194847048887e+00,
7370           0.5377371402113e-09, 0.6039381844671e+01, 0.4337116142245e+00,
7371 
7372           0.4729719431571e-09, 0.2153086311760e+01, 0.2132990797783e+00,
7373           0.4458052820973e-09, 0.5059830025565e+01, 0.5296909721118e+00,
7374           0.4406855467908e-09, 0.2027971692630e+01, 0.1589072916335e+01,
7375           0.3101659310977e-09, 0.3317677981860e+01, 0.1052268489556e+01,
7376           0.3016749232545e-09, 0.3913703482532e+01, 0.1066495398892e+01,
7377           0.3198541352656e-09, 0.1275513098525e+01, 0.1495633313810e+00,
7378           0.2142065389871e-09, 0.5301351614597e+01, 0.3163918923335e+00,
7379           0.1902615247592e-09, 0.4894943352736e+00, 0.2275259891141e+00,
7380           0.1613410990871e-09, 0.2449891130437e+01, 0.1102062672231e+00,
7381           0.1576992165097e-09, 0.4211421447633e+01, 0.7626583626240e-01,
7382 
7383           0.1241637259894e-09, 0.4140803368133e+01, 0.5154640627760e+00,
7384           0.1313974830355e-09, 0.3591920305503e+01, 0.3664874755930e-01,
7385           0.1181697118258e-09, 0.1506314382788e+01, 0.6327837846670e+00,
7386           0.1238239742779e-09, 0.7461405378404e+00, 0.3961708870310e-01,
7387           0.1010107068241e-09, 0.6271010795475e+00, 0.7329749511860e-01,
7388           0.9226316616509e-10, 0.1259158839583e+01, 0.1990721704425e+00,
7389           0.8664946419555e-10, 0.3353244696934e+01, 0.5439178814476e+00,
7390           0.7757230468978e-10, 0.1447677295196e+01, 0.9491756770005e+00,
7391           0.7693168628139e-10, 0.1120509896721e+01, 0.1030928125552e+00,
7392           0.5487897454612e-10, 0.4439380426795e+01, 0.8531963191132e+00,
7393 
7394           0.5196118677218e-10, 0.3788856619137e+00, 0.2093666171530e+00,
7395           0.5110853339935e-10, 0.1386879372016e+01, 0.2172315424036e+00,
7396           0.5027804534813e-10, 0.1647881805466e+00, 0.2164800718209e+00,
7397           0.4922485922674e-10, 0.1594315079862e+01, 0.2101180877357e+00,
7398           0.6155599524400e-10, 0.0000000000000e+00, 0.0000000000000e+00,
7399           0.4447147832161e-10, 0.5480720918976e+01, 0.3235053470014e+00,
7400           0.4144691276422e-10, 0.1931371033660e+01, 0.6373574839730e-01,
7401           0.4099950625452e-10, 0.5229611294335e+01, 0.6470106940028e+00,
7402           0.5060541682953e-10, 0.1731112486298e+01, 0.1422690933580e-01,
7403           0.4293615946300e-10, 0.2714571038925e+01, 0.7358765972222e+00,
7404 
7405           0.3545659845763e-10, 0.4451041444634e+01, 0.5265099800692e+00,
7406           0.3479112041196e-10, 0.3029385448081e+01, 0.5328719641544e+00,
7407           0.3438516493570e-10, 0.2778507143731e+01, 0.8582758298370e-01,
7408           0.3297341285033e-10, 0.7898709807584e+00, 0.1104591729320e-01,
7409           0.2972585818015e-10, 0.3218785316973e+01, 0.5257585094865e+00,
7410           0.2931707295017e-10, 0.4260731012098e+01, 0.5336234347371e+00,
7411           0.2897198149403e-10, 0.1120753978101e+01, 0.1173197218910e+00,
7412           0.2832293240878e-10, 0.4597682717827e+00, 0.2022531624851e+00,
7413           0.2864348326612e-10, 0.2169939928448e+01, 0.9597935788730e-01,
7414           0.2852714675471e-10, 0.2377659870578e+01, 0.2118763888447e+01 };
7415 
7416     /* SSB-to-Sun, T^1, Z */
7417       static final double s1z[] = {
7418           0.5444220475678e-08, 0.1803825509310e+01, 0.2132990797783e+00,
7419           0.3883412695596e-08, 0.4668616389392e+01, 0.5296909721118e+00,
7420           0.1334341434551e-08, 0.0000000000000e+00, 0.0000000000000e+00,
7421           0.3730001266883e-09, 0.5401405918943e+01, 0.2061856251104e+00,
7422           0.2894929197956e-09, 0.4932415609852e+01, 0.2204125344462e+00,
7423           0.2857950357701e-09, 0.3154625362131e+01, 0.7478166569050e-01,
7424           0.2499226432292e-09, 0.3657486128988e+01, 0.4265981595566e+00,
7425           0.1937705443593e-09, 0.5740434679002e+01, 0.1059381944224e+01,
7426           0.1374894396320e-09, 0.1712857366891e+01, 0.5368044267797e+00,
7427           0.1217248678408e-09, 0.2312090870932e+01, 0.5225775174439e+00,
7428 
7429           0.7961052740870e-10, 0.5283368554163e+01, 0.3813291813120e-01,
7430           0.4979225949689e-10, 0.4298290471860e+01, 0.4194847048887e+00,
7431           0.4388552286597e-10, 0.6145515047406e+01, 0.7113454667900e-02,
7432           0.2586835212560e-10, 0.3019448001809e+01, 0.6398972393349e+00 };
7433 
7434     /* SSB-to-Sun, T^2, X */
7435       static  final double s2x[] = {
7436           0.1603551636587e-11, 0.4404109410481e+01, 0.2061856251104e+00,
7437           0.1556935889384e-11, 0.4818040873603e+00, 0.2204125344462e+00,
7438           0.1182594414915e-11, 0.9935762734472e+00, 0.5225775174439e+00,
7439           0.1158794583180e-11, 0.3353180966450e+01, 0.5368044267797e+00,
7440           0.9597358943932e-12, 0.5567045358298e+01, 0.2132990797783e+00,
7441           0.6511516579605e-12, 0.5630872420788e+01, 0.4265981595566e+00,
7442           0.7419792747688e-12, 0.2156188581957e+01, 0.5296909721118e+00,
7443           0.3951972655848e-12, 0.1981022541805e+01, 0.1059381944224e+01,
7444           0.4478223877045e-12, 0.0000000000000e+00, 0.0000000000000e+00 };
7445 
7446     /* SSB-to-Sun, T^2, Y */
7447       static final double s2y[] = {
7448           0.1609114495091e-11, 0.2831096993481e+01, 0.2061856251104e+00,
7449           0.1560330784946e-11, 0.5193058213906e+01, 0.2204125344462e+00,
7450           0.1183535479202e-11, 0.5707003443890e+01, 0.5225775174439e+00,
7451           0.1158183066182e-11, 0.1782400404928e+01, 0.5368044267797e+00,
7452           0.1032868027407e-11, 0.4036925452011e+01, 0.2132990797783e+00,
7453           0.6540142847741e-12, 0.4058241056717e+01, 0.4265981595566e+00,
7454           0.7305236491596e-12, 0.6175401942957e+00, 0.5296909721118e+00,
7455          -0.5580725052968e-12, 0.0000000000000e+00, 0.0000000000000e+00,
7456           0.3946122651015e-12, 0.4108265279171e+00, 0.1059381944224e+01 };
7457 
7458     /* SSB-to-Sun, T^2, Z */
7459       static final double s2z[] = {
7460           0.3749920358054e-12, 0.3230285558668e+01, 0.2132990797783e+00,
7461           0.2735037220939e-12, 0.6154322683046e+01, 0.5296909721118e+00 };
7462         }
7463       
7464         /**
7465          *  Earth position and velocity, heliocentric and barycentric, with
7466          *  respect to the Barycentric Celestial Reference System.
7467          *
7468          *<p>This function is derived from the International Astronomical Union's
7469          *  SOFA (Standards Of Fundamental Astronomy) software collection.
7470          *
7471          *<p>Status:  support function.
7472          *
7473          *<!-- Given: -->
7474          *     @param date1 double         TDB date (Note 1)
7475          *     @param date2 double         TDB date (Note 1) 
7476          *
7477          *<!-- Returned: -->
7478          *     @param pvh           double[2][3]    <u>returned</u> heliocentric Earth position/velocity (au, au/d)
7479          *     @param pvb           double[2][3]    <u>returned</u> barycentric Earth position/velocity (au, au/d)
7480          *
7481          * <!-- Returned (function value): -->
7482          *  @return int           status: 0 = OK
7483          *                                       +1 = warning: date outside
7484          *                                            the range 1900-2100 AD
7485          *
7486          * <p>Notes:
7487          * <ol>
7488          *
7489          * <li> The TDB date date1+date2 is a Julian Date, apportioned in any
7490          *     convenient way between the two arguments.  For example,
7491          *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
7492          *     others:
7493          *<pre>
7494          *            date1          date2
7495          *
7496          *         2450123.7           0.0       (JD method)
7497          *         2451545.0       -1421.3       (J2000 method)
7498          *         2400000.5       50123.2       (MJD method)
7499          *         2450123.5           0.2       (date &amp; time method)
7500          *</pre>
7501          *     The JD method is the most natural and convenient to use in cases
7502          *     where the loss of several decimal digits of resolution is
7503          *     acceptable.  The J2000 method is best matched to the way the
7504          *     argument is handled internally and will deliver the optimum
7505          *     resolution.  The MJD method and the date &amp; time methods are both
7506          *     good compromises between resolution and convenience.  However,
7507          *     the accuracy of the result is more likely to be limited by the
7508          *     algorithm itself than the way the date has been expressed.
7509          *
7510          *     n.b. TT can be used instead of TDB in most applications.
7511          *
7512          * <li> On return, the arrays pvh and pvb contain the following:
7513          *
7514          *        pvh[0][0]  x       }
7515          *        pvh[0][1]  y       } heliocentric position, au
7516          *        pvh[0][2]  z       }
7517          *
7518          *        pvh[1][0]  xdot    }
7519          *        pvh[1][1]  ydot    } heliocentric velocity, au/d
7520          *        pvh[1][2]  zdot    }
7521          *
7522          *        pvb[0][0]  x       }
7523          *        pvb[0][1]  y       } barycentric position, au
7524          *        pvb[0][2]  z       }
7525          *
7526          *        pvb[1][0]  xdot    }
7527          *        pvb[1][1]  ydot    } barycentric velocity, au/d
7528          *        pvb[1][2]  zdot    }
7529          *
7530          *     The vectors are with respect to the Barycentric Celestial
7531          *     Reference System.  The time unit is one day in TDB.
7532          *
7533          * <li> The function is a SIMPLIFIED SOLUTION from the planetary theory
7534          *     VSOP2000 (X. Moisson, P. Bretagnon, 2001, Celes. Mechanics &amp;
7535          *     Dyn. Astron., 80, 3/4, 205-213) and is an adaptation of original
7536          *     Fortran code supplied by P. Bretagnon (private comm., 2000).
7537          *
7538          * <li> Comparisons over the time span 1900-2100 with this simplified
7539          *     solution and the JPL DE405 ephemeris give the following results:
7540          *
7541          *                                RMS    max
7542          *           Heliocentric:
7543          *              position error    3.7   11.2   km
7544          *              velocity error    1.4    5.0   mm/s
7545          *
7546          *           Barycentric:
7547          *              position error    4.6   13.4   km
7548          *              velocity error    1.4    4.9   mm/s
7549          *
7550          *     Comparisons with the JPL DE406 ephemeris show that by 1800 and
7551          *     2200 the position errors are approximately double their 1900-2100
7552          *     size.  By 1500 and 2500 the deterioration is a factor of 10 and
7553          *     by 1000 and 3000 a factor of 60.  The velocity accuracy falls off
7554          *     at about half that rate.
7555          *
7556          * <li> It is permissible to use the same array for pvh and pvb, which
7557          *     will receive the barycentric values.
7558          *</ol>
7559          *@version 2008 November 18
7560          *
7561          *  @since Release 20101201
7562          *
7563          *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7564          */
7565          public static int jauEpv00(final double date1, final double date2,
7566                       double pvh[][], double pvb[][])
7567          {
7568          /*
7569          * Matrix elements for orienting the analytical model to DE405.
7570          *
7571          * The corresponding Euler angles are:
7572          *
7573          *                       d  '  "
7574          *   1st rotation    -  23 26 21.4091 about the x-axis  (obliquity)
7575          *   2nd rotation    +         0.0475 about the z-axis  (RA offset)
7576          *
7577          * These were obtained empirically, by comparisons with DE405 over
7578          * 1900-2100.
7579          */
7580             final double am12 =  0.000000211284,
7581                                 am13 = -0.000000091603,
7582                                 am21 = -0.000000230286,
7583                                 am22 =  0.917482137087,
7584                                 am23 = -0.397776982902,
7585                                 am32 =  0.397776982902,
7586                                 am33 =  0.917482137087;
7587             
7588       
7589         
7590         
7591     /* Pointers to coefficient arrays, in x,y,z sets */
7592        final double ce0[][] = { Ephemeris.e0x, Ephemeris.e0y, Ephemeris.e0z },
7593                            ce1[][] = { Ephemeris.e1x, Ephemeris.e1y, Ephemeris.e1z },
7594                            ce2[][] = { Ephemeris.e2x, Ephemeris.e2y, Ephemeris.e2z },
7595                            cs0[][] = { Ephemeris.s0x, Ephemeris.s0y, Ephemeris.s0z },
7596                            cs1[][] = { Ephemeris.s1x, Ephemeris.s1y, Ephemeris.s1z },
7597                            cs2[][] = { Ephemeris.s2x, Ephemeris.s2y, Ephemeris.s2z };
7598        /* Numbers of terms for each component of the model, in x,y,z sets */
7599        final int ne0[] = {Ephemeris.e0x.length/3,
7600                Ephemeris.e0y.length/3,
7601                Ephemeris.e0z.length/3 },
7602                         ne1[] = {Ephemeris.e1x.length/3,
7603                Ephemeris.e1y.length/3,
7604                Ephemeris.e1z.length/3 },
7605                         ne2[] = {Ephemeris.e2x.length/3,
7606                Ephemeris.e2y.length/3,
7607                Ephemeris.e2z.length/3 },
7608                         ns0[] = {Ephemeris.s0x.length/3,
7609                Ephemeris.s0y.length/3,
7610                Ephemeris.s0z.length/3 },
7611                         ns1[] = {Ephemeris.s1x.length/3,
7612                Ephemeris.s1y.length/3,
7613                Ephemeris.s1z.length/3 },
7614                         ns2[] = {Ephemeris.s2x.length/3,
7615                Ephemeris.s2y.length/3,
7616                Ephemeris.s2z.length/3 };
7617        int nterms;
7618 
7619     /* Miscellaneous */
7620        int jstat, i, j;
7621        double t, t2, xyz, xyzd, a, b, c, ct, p, cp,
7622               ph[] = new double[3], vh[] = new double[3], pb[] = new double[3], vb[] = new double[3], x, y, z;
7623 
7624     /*--------------------------------------------------------------------*/
7625 
7626     /* Time since reference epoch, Julian years. */
7627        t = ((date1 - DJ00) + date2) / DJY;
7628        t2 = t*t;
7629 
7630     /* Set status. */
7631        jstat = abs(t) <= 100.0 ? 0 : 1;
7632 
7633     /* X then Y then Z. */
7634        for (i = 0; i < 3; i++) {
7635 
7636        /* Initialize position and velocity component. */
7637           xyz = 0.0;
7638           xyzd = 0.0;
7639 
7640        /* ------------------------------------------------ */
7641        /* Obtain component of Sun to Earth ecliptic vector */
7642        /* ------------------------------------------------ */
7643 
7644        /* Sun to Earth, T^0 terms. */
7645           nterms = ne0[i];
7646           int idx;
7647           for (j = 0, idx=0; j < nterms; j++) {
7648              a = ce0[i][idx++];
7649              b = ce0[i][idx++];
7650              c = ce0[i][idx++];
7651              p = b + c*t;
7652              xyz  += a*cos(p);
7653              xyzd -= a*c*sin(p);
7654           }
7655 
7656        /* Sun to Earth, T^1 terms. */
7657           nterms = ne1[i];
7658           for (j = 0, idx= 0; j < nterms; j++) {
7659              a = ce1[i][idx++];
7660              b = ce1[i][idx++];
7661              c = ce1[i][idx++];
7662              ct = c*t;
7663              p = b + ct;
7664              cp = cos(p);
7665              xyz  += a*t*cp;
7666              xyzd += a*( cp - ct*sin(p) );
7667           }
7668 
7669        /* Sun to Earth, T^2 terms. */
7670           nterms = ne2[i];
7671           for (j = 0, idx = 0; j < nterms; j++) {
7672              a = ce2[i][idx++];
7673              b = ce2[i][idx++];
7674              c = ce2[i][idx++];
7675              ct = c*t;
7676              p = b + ct;
7677              cp = cos(p);
7678              xyz  += a*t2*cp;
7679              xyzd += a*t*( 2.0*cp - ct*sin(p) );
7680           }
7681 
7682        /* Heliocentric Earth position and velocity component. */
7683           ph[i] = xyz;
7684           vh[i] = xyzd / DJY;
7685 
7686        /* ------------------------------------------------ */
7687        /* Obtain component of SSB to Earth ecliptic vector */
7688        /* ------------------------------------------------ */
7689 
7690        /* SSB to Sun, T^0 terms. */
7691           nterms = ns0[i];
7692           for (j = 0, idx = 0; j < nterms; j++) {
7693              a = cs0[i][idx++];
7694              b = cs0[i][idx++];
7695              c = cs0[i][idx++];
7696              p = b + c*t;
7697              xyz  += a*cos(p);
7698              xyzd -= a*c*sin(p);
7699           }
7700 
7701        /* SSB to Sun, T^1 terms. */
7702           nterms = ns1[i];
7703           for (j = 0, idx = 0; j < nterms; j++) {
7704              a = cs1[i][idx++];
7705              b = cs1[i][idx++];
7706              c = cs1[i][idx++];
7707              ct = c*t;
7708              p = b + ct;
7709              cp = cos(p);
7710              xyz  += a*t*cp;
7711              xyzd += a*(cp - ct*sin(p));
7712           }
7713 
7714        /* SSB to Sun, T^2 terms. */
7715           nterms = ns2[i];
7716           for (j = 0, idx = 0; j < nterms; j++) {
7717              a = cs2[i][idx++];
7718              b = cs2[i][idx++];
7719              c = cs2[i][idx++];
7720              ct = c*t;
7721              p = b + ct;
7722              cp = cos(p);
7723              xyz  += a*t2*cp;
7724              xyzd += a*t*(2.0*cp - ct*sin(p));
7725          }
7726 
7727        /* Barycentric Earth position and velocity component. */
7728          pb[i] = xyz;
7729          vb[i] = xyzd / DJY;
7730 
7731        /* Next Cartesian component. */
7732        }
7733 
7734     /* Rotate from ecliptic to BCRS coordinates. */
7735 
7736        x = ph[0];
7737        y = ph[1];
7738        z = ph[2];
7739        pvh[0][0] =      x + am12*y + am13*z;
7740        pvh[0][1] = am21*x + am22*y + am23*z;
7741        pvh[0][2] =          am32*y + am33*z;
7742 
7743        x = vh[0];
7744        y = vh[1];
7745        z = vh[2];
7746        pvh[1][0] =      x + am12*y + am13*z;
7747        pvh[1][1] = am21*x + am22*y + am23*z;
7748        pvh[1][2] =          am32*y + am33*z;
7749 
7750        x = pb[0];
7751        y = pb[1];
7752        z = pb[2];
7753        pvb[0][0] =      x + am12*y + am13*z;
7754        pvb[0][1] = am21*x + am22*y + am23*z;
7755        pvb[0][2] =          am32*y + am33*z;
7756 
7757        x = vb[0];
7758        y = vb[1];
7759        z = vb[2];
7760        pvb[1][0] =      x + am12*y + am13*z;
7761        pvb[1][1] = am21*x + am22*y + am23*z;
7762        pvb[1][2] =          am32*y + am33*z;
7763 
7764     /* Return the status. */
7765        return jstat;
7766 
7767         }
7768     
7769 
7770     /**
7771     *  Equation of the equinoxes, IAU 1994 model.
7772     *
7773     *<p>This function is derived from the International Astronomical Union's
7774     *  SOFA (Standards Of Fundamental Astronomy) software collection.
7775     *
7776     *<p>Status:  canonical model.
7777     *
7778     *<!-- Given: -->
7779     *     @param date1 double      TDB date (Note 1)
7780     *     @param date2 double      TDB date (Note 1) 
7781     *
7782     * <!-- Returned (function value): -->
7783     *  @return double     equation of the equinoxes (Note 2)
7784     *
7785     * <p>Notes:
7786     * <ol>
7787     *
7788     * <li> The date date1+date2 is a Julian Date, apportioned in any
7789     *     convenient way between the two arguments.  For example,
7790     *     JD(TT)=2450123.7 could be expressed in any of these ways,
7791     *     among others:
7792     *<pre>
7793     *            date1          date2
7794     *
7795     *         2450123.7           0.0       (JD method)
7796     *         2451545.0       -1421.3       (J2000 method)
7797     *         2400000.5       50123.2       (MJD method)
7798     *         2450123.5           0.2       (date &amp; time method)
7799     *</pre>
7800     *     The JD method is the most natural and convenient to use in
7801     *     cases where the loss of several decimal digits of resolution
7802     *     is acceptable.  The J2000 method is best matched to the way
7803     *     the argument is handled internally and will deliver the
7804     *     optimum resolution.  The MJD method and the date &amp; time methods
7805     *     are both good compromises between resolution and convenience.
7806     *
7807     * <li> The result, which is in radians, operates in the following sense:
7808     *
7809     *        Greenwich apparent ST = GMST + equation of the equinoxes
7810     *</ol>
7811     *<p>Called:<ul>
7812     *     <li>{@link #jauNut80} nutation, IAU 1980
7813     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
7814     * </ul>
7815     *<p>References:
7816     *
7817     *     <p>IAU Resolution C7, Recommendation 3 (1994).
7818     *
7819     *     <p>Capitaine, N. &amp; Gontier, A.-M., 1993, Astron. Astrophys., 275,
7820     *     645-650.
7821     *
7822     *@version 2008 May 24
7823     *
7824     *  @since Release 20101201
7825     *
7826     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7827     */
7828     public static double jauEqeq94(double date1, double date2)
7829     {
7830        double t,  om,  eps0, ee;
7831 
7832 
7833     /* Interval between fundamental epoch J2000.0 and given date (JC). */
7834        t = ((date1 - DJ00) + date2) / DJC;
7835 
7836     /* Longitude of the mean ascending node of the lunar orbit on the */
7837     /* ecliptic, measured from the mean equinox of date. */
7838        om = jauAnpm((450160.280 + (-482890.539
7839                + (7.455 + 0.008 * t) * t) * t) * DAS2R
7840                + fmod(-5.0 * t, 1.0) * D2PI);
7841 
7842     /* Nutation components and mean obliquity. */
7843        NutationTerms nt = jauNut80(date1, date2);
7844        eps0 = jauObl80(date1, date2);
7845 
7846     /* Equation of the equinoxes. */
7847        ee = nt.dpsi*cos(eps0) + DAS2R*(0.00264*sin(om) + 0.000063*sin(om+om));
7848 
7849        return ee;
7850 
7851         }
7852     
7853 
7854     /**
7855     *  Earth rotation angle (IAU 2000 model).
7856     *
7857     *<p>This function is derived from the International Astronomical Union's
7858     *  SOFA (Standards Of Fundamental Astronomy) software collection.
7859     *
7860     *<p>Status:  canonical model.
7861     *
7862     *<!-- Given: -->
7863     *     @param dj1 double     UT1 as a 2-part Julian Date (see note)
7864     *     @param dj2 double     UT1 as a 2-part Julian Date (see note) 
7865     *
7866     * <!-- Returned (function value): -->
7867     *  @return double    Earth rotation angle (radians), range 0-2pi
7868     *
7869     * <p>Notes:
7870     * <ol>
7871     *
7872     * <li> The UT1 date dj1+dj2 is a Julian Date, apportioned in any
7873     *     convenient way between the arguments dj1 and dj2.  For example,
7874     *     JD(UT1)=2450123.7 could be expressed in any of these ways,
7875     *     among others:
7876     *<pre>
7877     *             dj1            dj2
7878     *
7879     *         2450123.7           0.0       (JD method)
7880     *         2451545.0       -1421.3       (J2000 method)
7881     *         2400000.5       50123.2       (MJD method)
7882     *         2450123.5           0.2       (date &amp; time method)
7883     *</pre>
7884     *     The JD method is the most natural and convenient to use in
7885     *     cases where the loss of several decimal digits of resolution
7886     *     is acceptable.  The J2000 and MJD methods are good compromises
7887     *     between resolution and convenience.  The date &amp; time method is
7888     *     best matched to the algorithm used:  maximum precision is
7889     *     delivered when the dj1 argument is for 0hrs UT1 on the day in
7890     *     question and the dj2 argument lies in the range 0 to 1, or vice
7891     *     versa.
7892     *
7893     * <li> The algorithm is adapted from Expression 22 of Capitaine et al.
7894     *     2000.  The time argument has been expressed in days directly,
7895     *     and, to retain precision, integer contributions have been
7896     *     eliminated.  The same formulation is given in IERS Conventions
7897     *     (2003), Chap. 5, Eq. 14.
7898     *</ol>
7899     *<p>Called:<ul>
7900     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
7901     * </ul>
7902     *<p>References:
7903     *
7904     *     <p>Capitaine N., Guinot B. and McCarthy D.D, 2000, Astron.
7905     *     Astrophys., 355, 398-405.
7906     *
7907     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
7908     *     IERS Technical Note No. 32, BKG (2004)
7909     *
7910     *@version 2008 May 24
7911     *
7912     *  @since Release 20101201
7913     *
7914     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7915     */
7916     public static double jauEra00(double dj1, double dj2)
7917     {
7918        double d1, d2, t, f, theta;
7919 
7920 
7921     /* Days since fundamental epoch. */
7922        if (dj1 < dj2) {
7923           d1 = dj1;
7924           d2 = dj2;
7925        } else {
7926           d1 = dj2;
7927           d2 = dj1;
7928        }
7929        t = d1 + (d2- DJ00);
7930 
7931     /* Fractional part of T (days). */
7932        f = fmod(d1, 1.0) + fmod(d2, 1.0);
7933 
7934     /* Earth rotation angle at this UT1. */
7935        theta = jauAnp(D2PI * (f + 0.7790572732640
7936                                 + 0.00273781191135448 * t));
7937 
7938        return theta;
7939 
7940         }
7941     
7942 
7943     /**
7944     *  Fundamental argument, IERS Conventions (2003):
7945     *  mean elongation of the Moon from the Sun.
7946     *
7947     *<p>This function is derived from the International Astronomical Union's
7948     *  SOFA (Standards Of Fundamental Astronomy) software collection.
7949     *
7950     *<p>Status:  canonical model.
7951     *
7952     *<!-- Given: -->
7953     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
7954     *
7955     * <!-- Returned (function value): -->
7956     *  @return double    D, radians (Note 2)
7957     *
7958     * <p>Notes:
7959     * <ol>
7960     *
7961     * <li> Though t is strictly TDB, it is usually more convenient to use
7962     *     TT, which makes no significant difference.
7963     *
7964     * <li> The expression used is as adopted in IERS Conventions (2003) and
7965     *     is from Simon et al. (1994).
7966     *</ol>
7967     *<p>References:
7968     *
7969     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
7970     *     IERS Technical Note No. 32, BKG (2004)
7971     *
7972     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
7973     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
7974     *
7975     *@version 2009 December 16
7976     *
7977     *  @since Release 20101201
7978     *
7979     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7980     */
7981     public static double jauFad03(double t)
7982     {
7983        double a;
7984 
7985 
7986     /* Mean elongation of the Moon from the Sun (IERS Conventions 2003). */
7987        a = fmod(          1072260.703692 +
7988                  t * ( 1602961601.2090 +
7989                  t * (        - 6.3706 +
7990                  t * (          0.006593 +
7991                  t * (        - 0.00003169 ) ) ) ), TURNAS ) * DAS2R;
7992 
7993        return a;
7994 
7995         }
7996     
7997 
7998     /**
7999     *  Fundamental argument, IERS Conventions (2003):
8000     *  mean longitude of Earth.
8001     *
8002     *<p>This function is derived from the International Astronomical Union's
8003     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8004     *
8005     *<p>Status:  canonical model.
8006     *
8007     *<!-- Given: -->
8008     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8009     *
8010     * <!-- Returned (function value): -->
8011     *  @return double    mean longitude of Earth, radians (Note 2)
8012     *
8013     * <p>Notes:
8014     * <ol>
8015     *
8016     * <li> Though t is strictly TDB, it is usually more convenient to use
8017     *     TT, which makes no significant difference.
8018     *
8019     * <li> The expression used is as adopted in IERS Conventions (2003) and
8020     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8021     *</ol>
8022     *<p>References:
8023     *
8024     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8025     *     IERS Technical Note No. 32, BKG (2004)
8026     *
8027     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8028     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8029     *
8030     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8031     *     Astron.Astrophys.Supp.Ser. 135, 111
8032     *
8033     *@version 2009 December 16
8034     *
8035     *  @since Release 20101201
8036     *
8037     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8038     */
8039     public static double jauFae03(double t)
8040     {
8041        double a;
8042 
8043 
8044     /* Mean longitude of Earth (IERS Conventions 2003). */
8045        a = fmod(1.753470314 + 628.3075849991 * t, D2PI);
8046 
8047        return a;
8048 
8049         }
8050     
8051 
8052     /**
8053     *  Fundamental argument, IERS Conventions (2003):
8054     *  mean longitude of the Moon minus mean longitude of the ascending
8055     *  node.
8056     *
8057     *<p>This function is derived from the International Astronomical Union's
8058     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8059     *
8060     *<p>Status:  canonical model.
8061     *
8062     *<!-- Given: -->
8063     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8064     *
8065     * <!-- Returned (function value): -->
8066     *  @return double    F, radians (Note 2)
8067     *
8068     * <p>Notes:
8069     * <ol>
8070     *
8071     * <li> Though t is strictly TDB, it is usually more convenient to use
8072     *     TT, which makes no significant difference.
8073     *
8074     * <li> The expression used is as adopted in IERS Conventions (2003) and
8075     *     is from Simon et al. (1994).
8076     *</ol>
8077     *<p>References:
8078     *
8079     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8080     *     IERS Technical Note No. 32, BKG (2004)
8081     *
8082     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8083     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8084     *
8085     *@version 2009 December 16
8086     *
8087     *  @since Release 20101201
8088     *
8089     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8090     */
8091     public static double jauFaf03(double t)
8092     {
8093        double a;
8094 
8095 
8096     /* Mean longitude of the Moon minus that of the ascending node */
8097     /* (IERS Conventions 2003).                                    */
8098        a = fmod(           335779.526232 +
8099                  t * ( 1739527262.8478 +
8100                  t * (       - 12.7512 +
8101                  t * (        - 0.001037 +
8102                  t * (          0.00000417 ) ) ) ), TURNAS ) * DAS2R;
8103 
8104        return a;
8105 
8106 
8107         }
8108     
8109 
8110     /**
8111     *  Fundamental argument, IERS Conventions (2003):
8112     *  mean longitude of Jupiter.
8113     *
8114     *<p>This function is derived from the International Astronomical Union's
8115     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8116     *
8117     *<p>Status:  canonical model.
8118     *
8119     *<!-- Given: -->
8120     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8121     *
8122     * <!-- Returned (function value): -->
8123     *  @return double    mean longitude of Jupiter, radians (Note 2)
8124     *
8125     * <p>Notes:
8126     * <ol>
8127     *
8128     * <li> Though t is strictly TDB, it is usually more convenient to use
8129     *     TT, which makes no significant difference.
8130     *
8131     * <li> The expression used is as adopted in IERS Conventions (2003) and
8132     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8133     *</ol>
8134     *<p>References:
8135     *
8136     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8137     *     IERS Technical Note No. 32, BKG (2004)
8138     *
8139     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8140     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8141     *
8142     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8143     *     Astron.Astrophys.Supp.Ser. 135, 111
8144     *
8145     *@version 2009 December 16
8146     *
8147     *  @since Release 20101201
8148     *
8149     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8150     */
8151     public static double jauFaju03(double t)
8152     {
8153        double a;
8154 
8155 
8156     /* Mean longitude of Jupiter (IERS Conventions 2003). */
8157        a = fmod(0.599546497 + 52.9690962641 * t, D2PI);
8158 
8159        return a;
8160 
8161         }
8162     
8163 
8164     /**
8165     *  Fundamental argument, IERS Conventions (2003):
8166     *  mean anomaly of the Moon.
8167     *
8168     *<p>This function is derived from the International Astronomical Union's
8169     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8170     *
8171     *<p>Status:  canonical model.
8172     *
8173     *<!-- Given: -->
8174     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8175     *
8176     * <!-- Returned (function value): -->
8177     *  @return double    l, radians (Note 2)
8178     *
8179     * <p>Notes:
8180     * <ol>
8181     *
8182     * <li> Though t is strictly TDB, it is usually more convenient to use
8183     *     TT, which makes no significant difference.
8184     *
8185     * <li> The expression used is as adopted in IERS Conventions (2003) and
8186     *     is from Simon et al. (1994).
8187     *</ol>
8188     *<p>References:
8189     *
8190     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8191     *     IERS Technical Note No. 32, BKG (2004)
8192     *
8193     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8194     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8195     *
8196     *@version 2009 December 16
8197     *
8198     *  @since Release 20101201
8199     *
8200     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8201     */
8202     public static double jauFal03(double t)
8203     {
8204        double a;
8205 
8206 
8207     /* Mean anomaly of the Moon (IERS Conventions 2003). */
8208        a = fmod(           485868.249036  +
8209                  t * ( 1717915923.2178 +
8210                  t * (         31.8792 +
8211                  t * (          0.051635 +
8212                  t * (        - 0.00024470 ) ) ) ), TURNAS ) * DAS2R;
8213 
8214        return a;
8215 
8216         }
8217     
8218 
8219     /**
8220     *  Fundamental argument, IERS Conventions (2003):
8221     *  mean anomaly of the Sun.
8222     *
8223     *<p>This function is derived from the International Astronomical Union's
8224     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8225     *
8226     *<p>Status:  canonical model.
8227     *
8228     *<!-- Given: -->
8229     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8230     *
8231     * <!-- Returned (function value): -->
8232     *  @return double    l', radians (Note 2)
8233     *
8234     * <p>Notes:
8235     * <ol>
8236     *
8237     * <li> Though t is strictly TDB, it is usually more convenient to use
8238     *     TT, which makes no significant difference.
8239     *
8240     * <li> The expression used is as adopted in IERS Conventions (2003) and
8241     *     is from Simon et al. (1994).
8242     *</ol>
8243     *<p>References:
8244     *
8245     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8246     *     IERS Technical Note No. 32, BKG (2004)
8247     *
8248     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8249     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8250     *
8251     *@version 2009 December 16
8252     *
8253     *  @since Release 20101201
8254     *
8255     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8256     */
8257     public static double jauFalp03(double t)
8258     {
8259        double a;
8260 
8261 
8262     /* Mean anomaly of the Sun (IERS Conventions 2003). */
8263        a = fmod(         1287104.793048 +
8264                  t * ( 129596581.0481 +
8265                  t * (       - 0.5532 +
8266                  t * (         0.000136 +
8267                  t * (       - 0.00001149 ) ) ) ), TURNAS ) * DAS2R;
8268 
8269        return a;
8270 
8271         }
8272     
8273 
8274     /**
8275     *  Fundamental argument, IERS Conventions (2003):
8276     *  mean longitude of Mars.
8277     *
8278     *<p>This function is derived from the International Astronomical Union's
8279     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8280     *
8281     *<p>Status:  canonical model.
8282     *
8283     *<!-- Given: -->
8284     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8285     *
8286     * <!-- Returned (function value): -->
8287     *  @return double    mean longitude of Mars, radians (Note 2)
8288     *
8289     * <p>Notes:
8290     * <ol>
8291     *
8292     * <li> Though t is strictly TDB, it is usually more convenient to use
8293     *     TT, which makes no significant difference.
8294     *
8295     * <li> The expression used is as adopted in IERS Conventions (2003) and
8296     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8297     *</ol>
8298     *<p>References:
8299     *
8300     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8301     *     IERS Technical Note No. 32, BKG (2004)
8302     *
8303     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8304     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8305     *
8306     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8307     *     Astron.Astrophys.Supp.Ser. 135, 111
8308     *
8309     *@version 2009 December 16
8310     *
8311     *  @since Release 20101201
8312     *
8313     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8314     */
8315     public static double jauFama03(double t)
8316     {
8317        double a;
8318 
8319 
8320     /* Mean longitude of Mars (IERS Conventions 2003). */
8321        a = fmod(6.203480913 + 334.0612426700 * t, D2PI);
8322 
8323        return a;
8324 
8325         }
8326     
8327 
8328     /**
8329     *  Fundamental argument, IERS Conventions (2003):
8330     *  mean longitude of Mercury.
8331     *
8332     *<p>This function is derived from the International Astronomical Union's
8333     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8334     *
8335     *<p>Status:  canonical model.
8336     *
8337     *<!-- Given: -->
8338     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8339     *
8340     * <!-- Returned (function value): -->
8341     *  @return double    mean longitude of Mercury, radians (Note 2)
8342     *
8343     * <p>Notes:
8344     * <ol>
8345     *
8346     * <li> Though t is strictly TDB, it is usually more convenient to use
8347     *     TT, which makes no significant difference.
8348     *
8349     * <li> The expression used is as adopted in IERS Conventions (2003) and
8350     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8351     *</ol>
8352     *<p>References:
8353     *
8354     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8355     *     IERS Technical Note No. 32, BKG (2004)
8356     *
8357     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8358     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8359     *
8360     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8361     *     Astron.Astrophys.Supp.Ser. 135, 111
8362     *
8363     *@version 2009 December 16
8364     *
8365     *  @since Release 20101201
8366     *
8367     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8368     */
8369     public static double jauFame03(double t)
8370     {
8371        double a;
8372 
8373 
8374     /* Mean longitude of Mercury (IERS Conventions 2003). */
8375        a = fmod(4.402608842 + 2608.7903141574 * t, D2PI);
8376 
8377        return a;
8378 
8379         }
8380     
8381 
8382 
8383     /**
8384     *  Fundamental argument, IERS Conventions (2003):
8385     *  mean longitude of Neptune.
8386     *
8387     *<p>This function is derived from the International Astronomical Union's
8388     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8389     *
8390     *<p>Status:  canonical model.
8391     *
8392     *<!-- Given: -->
8393     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8394     *
8395     * <!-- Returned (function value): -->
8396     *  @return double    mean longitude of Neptune, radians (Note 2)
8397     *
8398     * <p>Notes:
8399     * <ol>
8400     *
8401     * <li> Though t is strictly TDB, it is usually more convenient to use
8402     *     TT, which makes no significant difference.
8403     *
8404     * <li> The expression used is as adopted in IERS Conventions (2003) and
8405     *     is adapted from Simon et al. (1994).
8406     *</ol>
8407     *<p>References:
8408     *
8409     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8410     *     IERS Technical Note No. 32, BKG (2004)
8411     *
8412     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8413     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8414     *
8415     *@version 2009 December 16
8416     *
8417     *  @since Release 20101201
8418     *
8419     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8420     */
8421     public static double jauFane03(double t)
8422     {
8423        double a;
8424 
8425 
8426     /* Mean longitude of Neptune (IERS Conventions 2003). */
8427        a = fmod(5.311886287 + 3.8133035638 * t, D2PI);
8428 
8429        return a;
8430 
8431         }
8432     
8433 
8434     /**
8435     *  Fundamental argument, IERS Conventions (2003):
8436     *  mean longitude of the Moon's ascending node.
8437     *
8438     *<p>This function is derived from the International Astronomical Union's
8439     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8440     *
8441     *<p>Status:  canonical model.
8442     *
8443     *<!-- Given: -->
8444     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8445     *
8446     * <!-- Returned (function value): -->
8447     *  @return double    Omega, radians (Note 2)
8448     *
8449     * <p>Notes:
8450     * <ol>
8451     *
8452     * <li> Though t is strictly TDB, it is usually more convenient to use
8453     *     TT, which makes no significant difference.
8454     *
8455     * <li> The expression used is as adopted in IERS Conventions (2003) and
8456     *     is from Simon et al. (1994).
8457     *</ol>
8458     *<p>References:
8459     *
8460     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8461     *     IERS Technical Note No. 32, BKG (2004)
8462     *
8463     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8464     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8465     *
8466     *@version 2009 December 16
8467     *
8468     *  @since Release 20101201
8469     *
8470     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8471     */
8472     public static double jauFaom03(double t)
8473     {
8474        double a;
8475 
8476 
8477     /* Mean longitude of the Moon's ascending node */
8478     /* (IERS Conventions 2003).                    */
8479        a = fmod(          450160.398036 +
8480                  t * ( - 6962890.5431 +
8481                  t * (         7.4722 +
8482                  t * (         0.007702 +
8483                  t * (       - 0.00005939 ) ) ) ), TURNAS ) * DAS2R;
8484 
8485        return a;
8486 
8487         }
8488     
8489 
8490     /**
8491     *  Fundamental argument, IERS Conventions (2003):
8492     *  general accumulated precession in longitude.
8493     *
8494     *<p>This function is derived from the International Astronomical Union's
8495     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8496     *
8497     *<p>Status:  canonical model.
8498     *
8499     *<!-- Given: -->
8500     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8501     *
8502     * <!-- Returned (function value): -->
8503     *  @return double    general precession in longitude, radians (Note 2)
8504     *
8505     * <p>Notes:
8506     * <ol>
8507     *
8508     * <li> Though t is strictly TDB, it is usually more convenient to use
8509     *     TT, which makes no significant difference.
8510     *
8511     * <li> The expression used is as adopted in IERS Conventions (2003).  It
8512     *     is taken from Kinoshita &amp; Souchay (1990) and comes originally
8513     *     from Lieske et al. (1977).
8514     *</ol>
8515     *<p>References:
8516     *
8517     *     Kinoshita, H. and Souchay J. 1990, Celest.Mech. and Dyn.Astron.
8518     *     48, 187
8519     *
8520     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B. 1977,
8521     *     Astron.Astrophys. 58, 1-16
8522     *
8523     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8524     *     IERS Technical Note No. 32, BKG (2004)
8525     *
8526     *@version 2009 December 16
8527     *
8528     *  @since Release 20101201
8529     *
8530     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8531     */
8532     public static double jauFapa03(double t)
8533     {
8534        double a;
8535 
8536 
8537     /* General accumulated precession in longitude. */
8538        a = (0.024381750 + 0.00000538691 * t) * t;
8539 
8540        return a;
8541 
8542         }
8543     
8544 
8545     /**
8546     *  Fundamental argument, IERS Conventions (2003):
8547     *  mean longitude of Saturn.
8548     *
8549     *<p>This function is derived from the International Astronomical Union's
8550     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8551     *
8552     *<p>Status:  canonical model.
8553     *
8554     *<!-- Given: -->
8555     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8556     *
8557     * <!-- Returned (function value): -->
8558     *  @return double    mean longitude of Saturn, radians (Note 2)
8559     *
8560     * <p>Notes:
8561     * <ol>
8562     *
8563     * <li> Though t is strictly TDB, it is usually more convenient to use
8564     *     TT, which makes no significant difference.
8565     *
8566     * <li> The expression used is as adopted in IERS Conventions (2003) and
8567     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8568     *</ol>
8569     *<p>References:
8570     *
8571     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8572     *     IERS Technical Note No. 32, BKG (2004)
8573     *
8574     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8575     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8576     *
8577     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8578     *     Astron.Astrophys.Supp.Ser. 135, 111
8579     *
8580     *@version 2009 December 16
8581     *
8582     *  @since Release 20101201
8583     *
8584     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8585     */
8586     public static double jauFasa03(double t)
8587     {
8588        double a;
8589 
8590 
8591     /* Mean longitude of Saturn (IERS Conventions 2003). */
8592        a = fmod(0.874016757 + 21.3299104960 * t, D2PI);
8593 
8594        return a;
8595 
8596         }
8597     
8598 
8599     /**
8600     *  Fundamental argument, IERS Conventions (2003):
8601     *  mean longitude of Uranus.
8602     *
8603     *<p>This function is derived from the International Astronomical Union's
8604     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8605     *
8606     *<p>Status:  canonical model.
8607     *
8608     *<!-- Given: -->
8609     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8610     *
8611     * <!-- Returned  (function value): -->
8612     *      @return     double    mean longitude of Uranus, radians (Note 2)
8613     *
8614     * <p>Notes:
8615     * <ol>
8616     *
8617     * <li> Though t is strictly TDB, it is usually more convenient to use
8618     *     TT, which makes no significant difference.
8619     *
8620     * <li> The expression used is as adopted in IERS Conventions (2003) and
8621     *     is adapted from Simon et al. (1994).
8622     *</ol>
8623     *<p>References:
8624     *
8625     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8626     *     IERS Technical Note No. 32, BKG (2004)
8627     *
8628     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8629     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8630     *
8631     *@version 2009 December 16
8632     *
8633     *  @since Release 20101201
8634     *
8635     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8636     */
8637     public static double jauFaur03(double t)
8638     {
8639        double a;
8640 
8641 
8642     /* Mean longitude of Uranus (IERS Conventions 2003). */
8643        a = fmod(5.481293872 + 7.4781598567 * t, D2PI);
8644 
8645        return a;
8646 
8647         }
8648     
8649 
8650     /**
8651     *  Fundamental argument, IERS Conventions (2003):
8652     *  mean longitude of Venus.
8653     *
8654     *<p>This function is derived from the International Astronomical Union's
8655     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8656     *
8657     *<p>Status:  canonical model.
8658     *
8659     *<!-- Given: -->
8660     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8661     *
8662     * <!-- Returned (function value): -->
8663     *  @return double    mean longitude of Venus, radians (Note 2)
8664     *
8665     * <p>Notes:
8666     * <ol>
8667     *
8668     * <li> Though t is strictly TDB, it is usually more convenient to use
8669     *     TT, which makes no significant difference.
8670     *
8671     * <li> The expression used is as adopted in IERS Conventions (2003) and
8672     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8673     *</ol>
8674     *<p>References:
8675     *
8676     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8677     *     IERS Technical Note No. 32, BKG (2004)
8678     *
8679     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8680     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8681     *
8682     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8683     *     Astron.Astrophys.Supp.Ser. 135, 111
8684     *
8685     *@version 2009 December 16
8686     *
8687     *  @since Release 20101201
8688     *
8689     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8690     */
8691     public static double jauFave03(double t)
8692     {
8693        double a;
8694 
8695 
8696     /* Mean longitude of Venus (IERS Conventions 2003). */
8697        a = fmod(3.176146697 + 1021.3285546211 * t, D2PI);
8698 
8699        return a;
8700 
8701         }
8702     
8703 
8704     /**
8705     *  Transform FK5 (J2000.0) star data into the Hipparcos system.
8706     *
8707     *<p>This function is derived from the International Astronomical Union's
8708     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8709     *
8710     *<p>Status:  support function.
8711     *
8712     *  Given (all FK5, equinox J2000.0, epoch J2000.0):
8713     *    @param r5      double    RA (radians)
8714     *    @param d5      double    Dec (radians)
8715     *    @param dr5     double    proper motion in RA (dRA/dt, rad/Jyear)
8716     *    @param dd5     double    proper motion in Dec (dDec/dt, rad/Jyear)
8717     *    @param px5     double    parallax (arcsec)
8718     *    @param rv5     double    radial velocity (km/s, positive = receding)
8719     *
8720     *  Returned (all Hipparcos, epoch J2000.0):
8721     *  @return catalogue coordinates
8722     *
8723     * <p>Notes:
8724     * <ol>
8725     *
8726     * <li> This function transforms FK5 star positions and proper motions
8727     *     into the system of the Hipparcos catalog.
8728     *
8729     * <li> The proper motions in RA are dRA/dt rather than
8730     *     cos(Dec)*dRA/dt, and are per year rather than per century.
8731     *
8732     * <li> The FK5 to Hipparcos transformation is modeled as a pure
8733     *     rotation and spin;  zonal errors in the FK5 catalog are not
8734     *     taken into account.
8735     *
8736     * <li> See also {@link #jauH2fk5}, {@link #jauFk5hz}, {@link #jauHfk5z}.
8737     *</ol>
8738     *<p>Called:<ul>
8739     *     <li>{@link #jauStarpv} star catalog data to space motion pv-vector
8740     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
8741     *     <li>{@link #jauRxp} product of r-matrix and p-vector
8742     *     <li>{@link #jauPxp} vector product of two p-vectors
8743     *     <li>{@link #jauPpp} p-vector plus p-vector
8744     *     <li>{@link #jauPvstar} space motion pv-vector to star catalog data
8745     * </ul>
8746     *<p>Reference:
8747     *
8748     *     <p>F.Mignard &amp; M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
8749     *
8750     *@version 2009 December 17
8751     *
8752     *  @since Release 20101201
8753     *
8754     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8755     */
8756     public static CatalogCoords jauFk52h(double r5, double d5,
8757                   double dr5, double dd5, double px5, double rv5)
8758     {
8759        int i;
8760        double pv5[][] = new double[2][3], r5h[][] = new double[3][3], s5h[] = new double[3], wxp[] = new double[3], vv[] = new double[3], pvh[][] = new double[2][3];
8761 
8762 
8763     /* FK5 barycentric position/velocity pv-vector (normalized). */
8764        jauStarpv(r5, d5, dr5, dd5, px5, rv5, pv5);
8765 
8766     /* FK5 to Hipparcos orientation matrix and spin vector. */
8767        jauFk5hip(r5h, s5h);
8768 
8769     /* Make spin units per day instead of per year. */
8770        for ( i = 0; i < 3; s5h[i++] /= 365.25 );
8771 
8772     /* Orient the FK5 position into the Hipparcos system. */
8773        pvh[0] = jauRxp(r5h, pv5[0]);
8774 
8775     /* Apply spin to the position giving an extra space motion component. */
8776        wxp = jauPxp(pv5[0],s5h);
8777 
8778     /* Add this component to the FK5 space motion. */
8779        vv = jauPpp(wxp, pv5[1]);
8780 
8781     /* Orient the FK5 space motion into the Hipparcos system. */
8782        pvh[1] = jauRxp(r5h, vv);
8783 
8784     /* Hipparcos pv-vector to spherical. */
8785        CatalogCoords cat = null;
8786        try {
8787            cat = jauPvstar(pvh);
8788        } catch (JSOFAInternalError e) {
8789            //original code ignored possibility of error too...
8790            e.printStackTrace();
8791        }
8792 
8793        return cat;
8794 
8795         }
8796     
8797 
8798     /**
8799     *  FK5 to Hipparcos rotation and spin.
8800     *
8801     *<p>This function is derived from the International Astronomical Union's
8802     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8803     *
8804     *<p>Status:  support function.
8805     *
8806     *<!-- Returned: -->
8807     *     @param r5h    double[3][3]    <u>returned</u> r-matrix: FK5 rotation wrt Hipparcos (Note 2)
8808     *     @param s5h    double[3]       <u>returned</u> r-vector: FK5 spin wrt Hipparcos (Note 3)
8809     *
8810     * <p>Notes:
8811     * <ol>
8812     *
8813     * <li> This function models the FK5 to Hipparcos transformation as a
8814     *     pure rotation and spin;  zonal errors in the FK5 catalogue are
8815     *     not taken into account.
8816     *
8817     * <li> The r-matrix r5h operates in the sense:
8818     *
8819     *           P_Hipparcos = r5h x P_FK5
8820     *
8821     *     where P_FK5 is a p-vector in the FK5 frame, and P_Hipparcos is
8822     *     the equivalent Hipparcos p-vector.
8823     *
8824     * <li> The r-vector s5h represents the time derivative of the FK5 to
8825     *     Hipparcos rotation.  The units are radians per year (Julian,
8826     *     TDB).
8827     *</ol>
8828     *<p>Called:<ul>
8829     *     <li>{@link #jauRv2m} r-vector to r-matrix
8830     * </ul>
8831     *<p>Reference:
8832     *
8833     *     <p>F.Mignard &amp; M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
8834     *
8835     *@version 2009 March 14
8836     *
8837     *  @since Release 20101201
8838     *
8839     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8840     */
8841     public static void jauFk5hip(double r5h[][], double s5h[] )
8842     {
8843        double v[] = new double[3];
8844 
8845     /* FK5 wrt Hipparcos orientation and spin (radians, radians/year) */
8846        double epx, epy, epz;
8847        double omx, omy, omz;
8848 
8849 
8850        epx = -19.9e-3 * DAS2R;
8851        epy =  -9.1e-3 * DAS2R;
8852        epz =  22.9e-3 * DAS2R;
8853 
8854        omx = -0.30e-3 * DAS2R;
8855        omy =  0.60e-3 * DAS2R;
8856        omz =  0.70e-3 * DAS2R;
8857 
8858     /* FK5 to Hipparcos orientation expressed as an r-vector. */
8859        v[0] = epx;
8860        v[1] = epy;
8861        v[2] = epz;
8862 
8863     /* Re-express as an r-matrix. */
8864        double[][] r5ht = jauRv2m(v);
8865        jauCr(r5ht, r5h);
8866 
8867     /* Hipparcos wrt FK5 spin expressed as an r-vector. */
8868        s5h[0] = omx;
8869        s5h[1] = omy;
8870        s5h[2] = omz;
8871 
8872        return;
8873 
8874         }
8875     
8876   /**
8877   * Position consisting of (&alpha;, &delta;) pairs in radians. Where &alpha; is right ascension (or longitude angle) and &delta; is declination (or latitude angle).
8878  * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
8879  * 
8880  * @since AIDA Stage 1
8881  */
8882 public static class SphericalCoordinate {
8883       public double alpha;
8884       public double delta;
8885       public SphericalCoordinate(double alpha, double delta){
8886           this.alpha = alpha;
8887           this.delta = delta;
8888       }
8889   }
8890 
8891 /**
8892  * Spherical coordinate with equation of origins .
8893  * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Mar 2014
8894  * @version $Revision$ $date$
8895  */
8896 public static class SphericalCoordinateEO {
8897     public SphericalCoordinate pos;
8898     public double eo;
8899     /**
8900      * @param pos the spherical position.
8901      * @param eo the equation of thr origins.
8902      */
8903     public SphericalCoordinateEO(SphericalCoordinate pos, double eo) {
8904         this.pos = pos;
8905         this.eo = eo;
8906     }
8907     
8908     
8909 }
8910     /**
8911     *  Transform an FK5 (J2000.0) star position into the system of the
8912     *  Hipparcos catalogue, assuming zero Hipparcos proper motion.
8913     *
8914     *<p>This function is derived from the International Astronomical Union's
8915     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8916     *
8917     *<p>Status:  support function.
8918     *
8919     *<!-- Given: -->
8920     *     @param r5            double    FK5 RA (radians), equinox J2000.0, at date
8921     *     @param d5            double    FK5 Dec (radians), equinox J2000.0, at date
8922     *     @param date1 double    TDB date (Notes 1,2)
8923     *     @param date2 double    TDB date (Notes 1,2) 
8924     *
8925     *<!-- Returned: -->
8926     *     @return rh            double     <u>returned</u> Hipparcos RA (radians)
8927     *             dh            double     <u>returned</u> Hipparcos Dec (radians)
8928     *
8929     * <p>Notes:
8930     * <ol>
8931     *
8932     * <li> This function converts a star position from the FK5 system to
8933     *     the Hipparcos system, in such a way that the Hipparcos proper
8934     *     motion is zero.  Because such a star has, in general, a non-zero
8935     *     proper motion in the FK5 system, the function requires the date
8936     *     at which the position in the FK5 system was determined.
8937     *
8938     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
8939     *     convenient way between the two arguments.  For example,
8940     *     JD(TT)=2450123.7 could be expressed in any of these ways,
8941     *     among others:
8942     *<pre>
8943     *            date1          date2
8944     *
8945     *         2450123.7           0.0       (JD method)
8946     *         2451545.0       -1421.3       (J2000 method)
8947     *         2400000.5       50123.2       (MJD method)
8948     *         2450123.5           0.2       (date &amp; time method)
8949     *</pre>
8950     *     The JD method is the most natural and convenient to use in
8951     *     cases where the loss of several decimal digits of resolution
8952     *     is acceptable.  The J2000 method is best matched to the way
8953     *     the argument is handled internally and will deliver the
8954     *     optimum resolution.  The MJD method and the date &amp; time methods
8955     *     are both good compromises between resolution and convenience.
8956     *
8957     * <li> The FK5 to Hipparcos transformation is modeled as a pure
8958     *     rotation and spin;  zonal errors in the FK5 catalogue are not
8959     *     taken into account.
8960     *
8961     * <li> The position returned by this function is in the Hipparcos
8962     *     reference system but at date date1+date2.
8963     *
8964     * <li> See also jauFk52h, jauH2fk5, jauHfk5z.
8965     *</ol>
8966     *<p>Called:<ul>
8967     *     <li>{@link #jauS2c} spherical coordinates to unit vector
8968     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
8969     *     <li>{@link #jauSxp} multiply p-vector by scalar
8970     *     <li>{@link #jauRv2m} r-vector to r-matrix
8971     *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
8972     *     <li>{@link #jauPxp} vector product of two p-vectors
8973     *     <li>{@link #jauC2s} p-vector to spherical
8974     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
8975     * </ul>
8976     *<p>Reference:
8977     *
8978     *     <p>F.Mignard &amp; M.Froeschle, 2000, Astron.Astrophys. 354, 732-739.
8979     *
8980     *@version 2009 December 17
8981     *
8982     *  @since Release 20101201
8983     *
8984     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8985     */
8986     public static SphericalCoordinate jauFk5hz(double r5, double d5, double date1, double date2
8987                   )
8988     {
8989        double t, p5e[] = new double[3], r5h[][] = new double[3][3], s5h[] = new double[3], vst[] = new double[3], rst[][] = new double[3][3], p5[] = new double[3],
8990               ph[] = new double[3];
8991 
8992 
8993     /* Interval from given date to fundamental epoch J2000.0 (JY). */
8994        t = - ((date1 - DJ00) + date2) / DJY;
8995 
8996     /* FK5 barycentric position vector. */
8997        p5e = jauS2c(r5,d5);
8998 
8999     /* FK5 to Hipparcos orientation matrix and spin vector. */
9000        jauFk5hip(r5h, s5h);
9001 
9002     /* Accumulated Hipparcos wrt FK5 spin over that interval. */
9003        vst = jauSxp(t,s5h);
9004 
9005     /* Express the accumulated spin as a rotation matrix. */
9006        rst = jauRv2m(vst);
9007 
9008     /* Derotate the vector's FK5 axes back to date. */
9009        p5 = jauTrxp(rst, p5e);
9010 
9011     /* Rotate the vector into the Hipparcos system. */
9012        ph = jauRxp(r5h, p5);
9013 
9014     /* Hipparcos vector to spherical. */
9015        SphericalCoordinate sc = jauC2s(ph);
9016        double rh = jauAnp(sc.alpha);
9017        sc.alpha = rh;
9018        
9019        return sc;
9020 
9021         }
9022     
9023 
9024     /**
9025     *  Form rotation matrix given the Fukushima-Williams angles.
9026     *
9027     *<p>This function is derived from the International Astronomical Union's
9028     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9029     *
9030     *<p>Status:  support function.
9031     *
9032     *<!-- Given: -->
9033     *     @param gamb      double          F-W angle gamma_bar (radians)
9034     *     @param phib      double          F-W angle phi_bar (radians)
9035     *     @param psi       double          F-W angle psi (radians)
9036     *     @param eps       double          F-W angle epsilon (radians)
9037     *
9038     *<!-- Returned: -->
9039     *     @return r         double[3][3]     <u>returned</u> rotation matrix
9040     *
9041     * <p>Notes:
9042     * <ol>
9043     *
9044     * <li> Naming the following points:
9045     *
9046     *           e = J2000.0 ecliptic pole,
9047     *           p = GCRS pole,
9048     *           E = ecliptic pole of date,
9049     *     and   P = CIP,
9050     *
9051     *     the four Fukushima-Williams angles are as follows:
9052     *
9053     *        gamb = gamma = epE
9054     *        phib = phi = pE
9055     *        psi = psi = pEP
9056     *        eps = epsilon = EP
9057     *
9058     * <li> The matrix representing the combined effects of frame bias,
9059     *     precession and nutation is:
9060     *
9061     *        NxPxB = R_1(-eps).R_3(-psi).R_1(phib).R_3(gamb)
9062     *
9063     * <li> Three different matrices can be constructed, depending on which angles are supplied as the arguments gamb,
9064     *      phib, psi and eps:
9065     *
9066     *     o  To obtain the nutation x precession x frame bias matrix,
9067     *        first generate the four precession angles known conventionally
9068     *        as gamma_bar, phi_bar, psi_bar and epsilon_A, then generate
9069     *        the nutation components Dpsi and Depsilon and add them to
9070     *        psi_bar and epsilon_A, and finally call the present function
9071     *        using those four angles as arguments.
9072     *
9073     *     o  To obtain the precession x frame bias matrix, generate the
9074     *        four precession angles and call the present function.
9075     *
9076     *     o  To obtain the frame bias matrix, generate the four precession
9077     *        angles for date J2000.0 and call the present function.
9078     *
9079     *     The nutation-only and precession-only matrices can if necessary
9080     *     be obtained by combining these three appropriately.
9081     *</ol>
9082     *<p>Called:<ul>
9083     *     <li>{@link #jauIr} initialize r-matrix to identity
9084     *     <li>{@link #jauRz} rotate around Z-axis
9085     *     <li>{@link #jauRx} rotate around X-axis
9086     * </ul>
9087     *<p>References:
9088     *
9089     *     Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
9090     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
9091     *
9092     *@version 2020 November 13
9093     *
9094     *  @since Release 20101201
9095     *
9096     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9097     */
9098     public static double[][] jauFw2m(double gamb, double phib, double psi, double eps)
9099     {
9100     /* Construct the matrix. */
9101        double r[][] = new double[3][3];
9102        jauIr(r);
9103        jauRz(gamb, r);
9104        jauRx(phib, r);
9105        jauRz(-psi, r);
9106        jauRx(-eps, r);
9107 
9108        return r;
9109 
9110         }
9111     
9112 
9113     /**
9114     *  CIP X,Y given Fukushima-Williams bias-precession-nutation angles.
9115     *
9116     *<p>This function is derived from the International Astronomical Union's
9117     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9118     *
9119     *<p>Status:  support function.
9120     *
9121     *<!-- Given: -->
9122     *     @param gamb      double     F-W angle gamma_bar (radians)
9123     *     @param phib      double     F-W angle phi_bar (radians)
9124     *     @param psi       double     F-W angle psi (radians)
9125     *     @param eps       double     F-W angle epsilon (radians)
9126     *
9127     *<!-- Returned: -->
9128     *     @return CIP unit vector X,Y
9129     *
9130     * <p>Notes:
9131     * <ol>
9132     *
9133     * <li> Naming the following points:
9134     *
9135     *           e = J2000.0 ecliptic pole,
9136     *           p = GCRS pole
9137     *           E = ecliptic pole of date,
9138     *     and   P = CIP,
9139     *
9140     *     the four Fukushima-Williams angles are as follows:
9141     *
9142     *        gamb = gamma = epE
9143     *        phib = phi = pE
9144     *        psi = psi = pEP
9145     *        eps = epsilon = EP
9146     *
9147     * <li> The matrix representing the combined effects of frame bias,
9148     *     precession and nutation is:
9149     *
9150     *        NxPxB = R_1(-epsA).R_3(-psi).R_1(phib).R_3(gamb)
9151     *
9152     *       The returned values x,y are elements [2][0] and [2][1] of the
9153     *       matrix.  Near J2000.0, they are essentially angles in radians
9154     *       
9155     *     X,Y are elements (3,1) and (3,2) of the matrix.
9156     *</ol>
9157     *<p>Called:<ul>
9158     *     <li>{@link #jauFw2m} F-W angles to r-matrix
9159     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
9160     * </ul>
9161     *<p>Reference:
9162     *
9163     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
9164     *
9165     *@version 2009 December 17
9166     *
9167     *  @since Release 20101201
9168     *
9169     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9170     */
9171     public static CelestialIntermediatePole jauFw2xy(double gamb, double phib, double psi, double eps)
9172     {
9173        double r[][] = new double[3][3];
9174 
9175 
9176     /* Form NxPxB matrix. */
9177        r = jauFw2m(gamb, phib, psi, eps);
9178 
9179     /* Extract CIP X,Y. */
9180        return jauBpn2xy(r);
9181 
9182     }
9183 
9184     /**
9185      * Geodetic coordinates.
9186      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
9187      * 
9188      * @since AIDA Stage 1
9189      */
9190     public static class GeodeticCoord {
9191         /** longitude (radians, east +ve) */
9192         public  double elong;
9193         /** latitude (geodetic, radians) */
9194         public double phi;
9195         /** height above ellipsoid (geodetic) */
9196         public double height;
9197         public GeodeticCoord(double elong, double phi, double height) {
9198             this.elong = elong;
9199             this.phi = phi;
9200             this.height = height;
9201         }
9202 }
9203     /**
9204     *  Transform geocentric coordinates to geodetic using the specified
9205     *  reference ellipsoid.
9206     *
9207     *<p>This function is derived from the International Astronomical Union's
9208     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9209     *
9210     *<p>Status:  canonical transformation.
9211     *
9212     *<!-- Given: -->
9213     *     @param n        int         ellipsoid identifier (Note 1)
9214     *     @param xyz      double[3]   geocentric vector (Note 2)
9215     *
9216     *<!-- Returned: -->
9217     *     @return elong    double       <u>returned</u> longitude (radians, east +ve)
9218     *             phi      double       <u>returned</u> latitude (geodetic, radians, Note 3)
9219     *             height   double       <u>returned</u> height above ellipsoid (geodetic, Notes 2,3)
9220     *
9221     * <!-- Returned (function value): -->
9222     *  @throws JSOFAIllegalParameter 0 = OK
9223     *                         -1 = illegal identifier (Note 3)
9224     *                         -2 = internal error (Note 3)
9225     *
9226     * <p>Notes:
9227     * <ol>
9228     *
9229     * <li> The identifier n is a number that specifies the choice of
9230     *     reference ellipsoid.  The following are supported:
9231     *
9232     *        n   ellipsoid
9233     *
9234     *        1    WGS84
9235     *        2    GRS80
9236     *
9237     *     The number n has no significance outside the JSOFA software.
9238     *
9239     * <li> The geocentric vector (xyz, given) and height (height, returned)
9240     *     are in meters.
9241     *
9242     * <li> An error status -1 means that the identifier n is illegal.  An
9243     *     error status -2 is theoretically impossible.  In all error cases,
9244     *     phi and height are both set to -1e9.
9245     *
9246     * <li> The inverse transformation is performed in the function jauGd2gc.
9247     *</ol>
9248     *<p>Called:<ul>
9249     *     <li>{@link #jauEform} Earth reference ellipsoids
9250     *     <li>{@link #jauGc2gde} geocentric to geodetic transformation, general
9251     * </ul>
9252     *@version 2010 January 18
9253     *
9254     *  @since Release 20101201
9255     *
9256     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9257     */
9258     public static GeodeticCoord jauGc2gd ( int n, double xyz[] ) throws JSOFAIllegalParameter
9259     {
9260       GeodeticCoord gc;
9261 
9262 
9263     /* Obtain reference ellipsoid parameters. */
9264        ReferenceEllipsoid el = jauEform ( n );
9265 
9266     /* If OK, transform x,y,z to longitude, geodetic latitude, height. */
9267        gc = jauGc2gde ( el.a, el.f, xyz);
9268 
9269     /* Return the status. */
9270        return gc;
9271 
9272     
9273     }
9274     
9275    /**
9276     *  Transform geocentric coordinates to geodetic for a reference
9277     *  ellipsoid of specified form.
9278     *
9279     *<p>This function is derived from the International Astronomical Union's
9280     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9281     *
9282     *<p>Status:  support function.
9283     *
9284     *<!-- Given: -->
9285     *     @param a        double      equatorial radius (Notes 2,4)
9286     *     @param f        double      flattening (Note 3)
9287     *     @param xyz      double[3]   geocentric vector (Note 4)
9288     *
9289     *<!-- Returned: -->
9290     *     @return GeodeticCoord   logitude  (radians, east +ve) latitude (geodetic, radians)  height above ellipsoid (geodetic, Note 4)
9291     *
9292     *  @throws JSOFAIllegalParameter int       status:
9293     *               
9294     *                         -1 = illegal a
9295     *                         -2 = illegal f
9296     *
9297     * <p>Notes:
9298     * <ol>
9299     *
9300     * <li> This function is based on the GCONV2H Fortran subroutine by
9301     *     Toshio Fukushima (see reference).
9302     *
9303     * <li> The equatorial radius, a, can be in any units, but meters is
9304     *     the conventional choice.
9305     *
9306     * <li> The flattening, f, is (for the Earth) a value around 0.00335,
9307     *     i.e. around 1/298.
9308     *
9309     * <li> The equatorial radius, a, and the geocentric vector, xyz,
9310     *     must be given in the same units, and determine the units of
9311     *     the returned height, height.
9312     *
9313     * <li> If an error occurs (status &lt; 0), elong, phi and height are
9314     *     unchanged.
9315     *
9316     * <li> The inverse transformation is performed in the function
9317     *     jauGd2gce.
9318     *
9319     * <li> The transformation for a standard ellipsoid (such as WGS84) can
9320     *     more conveniently be performed by calling jauGc2gd, which uses a
9321     *     numerical code (1 for WGS84) to identify the required A and F
9322     *     values.
9323     *</ol>
9324     *<p>Reference:
9325     *
9326     *     Fukushima, T., "Transformation from Cartesian to geodetic
9327     *     coordinates accelerated by Halley's method", J.Geodesy (2006)
9328     *     79: 689-693
9329     *
9330     *@version 2009 November 2
9331     *
9332     *  @since Release 20101201
9333     *
9334     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9335  * 
9336     */
9337     public static GeodeticCoord jauGc2gde ( double a, double f, double xyz[] ) throws JSOFAIllegalParameter
9338         {
9339        double aeps2, e2, e4t, ec2, ec, b, x, y, z, p2, absz, p, s0, pn, zc,
9340                      c0, c02, c03, s02, s03, a02, a0, a03, d0, f0, b0, s1,
9341                      cc, s12, cc2;
9342 
9343       double  phi, height;
9344     /* ------------- */
9345     /* Preliminaries */
9346     /* ------------- */
9347 
9348     /* Validate ellipsoid parameters. */
9349        if ( f < 0.0 || f >= 1.0 ) throw new JSOFAIllegalParameter("bad f", -1);
9350        if ( a <= 0.0 ) throw new JSOFAIllegalParameter("bad a", -2);
9351 
9352     /* Functions of ellipsoid parameters (with further validation of f). */
9353        aeps2 = a*a * 1e-32;
9354        e2 = (2.0 - f) * f;
9355        e4t = e2*e2 * 1.5;
9356        ec2 = 1.0 - e2;
9357        if ( ec2 <= 0.0 ) throw new JSOFAIllegalParameter("bad f", -1);
9358        ec = sqrt(ec2);
9359        b = a * ec;
9360 
9361     /* Cartesian components. */
9362        x = xyz[0];
9363        y = xyz[1];
9364        z = xyz[2];
9365 
9366     /* Distance from polar axis squared. */
9367        p2 = x*x + y*y;
9368 
9369     /* Longitude. */
9370        double elong = p2 > 0.0 ? atan2(y, x) : 0.0;
9371 
9372     /* Unsigned z-coordinate. */
9373        absz = abs(z);
9374 
9375     /* Proceed unless polar case. */
9376        if ( p2 > aeps2 ) {
9377 
9378        /* Distance from polar axis. */
9379           p = sqrt(p2);
9380 
9381        /* Normalization. */
9382           s0 = absz / a;
9383           pn = p / a;
9384           zc = ec * s0;
9385 
9386        /* Prepare Newton correction factors. */
9387           c0 = ec * pn;
9388           c02 = c0 * c0;
9389           c03 = c02 * c0;
9390           s02 = s0 * s0;
9391           s03 = s02 * s0;
9392           a02 = c02 + s02;
9393           a0 = sqrt(a02);
9394           a03 = a02 * a0;
9395           d0 = zc*a03 + e2*s03;
9396           f0 = pn*a03 - e2*c03;
9397 
9398        /* Prepare Halley correction factor. */
9399           b0 = e4t * s02 * c02 * pn * (a0 - ec);
9400           s1 = d0*f0 - b0*s0;
9401           cc = ec * (f0*f0 - b0*c0);
9402 
9403        /* Evaluate latitude and height. */
9404           phi = atan(s1/cc);
9405           s12 = s1 * s1;
9406           cc2 = cc * cc;
9407           height = (p*cc + absz*s1 - a * sqrt(ec2*s12 + cc2)) /
9408                                                             sqrt(s12 + cc2);
9409        } else {
9410 
9411        /* Exception: pole. */
9412           phi = DPI / 2.0;
9413           height = absz - b;
9414        }
9415 
9416     /* Restore sign of latitude. */
9417        if ( z < 0 ) phi = -phi;
9418 
9419     /* OK status. */
9420        return new GeodeticCoord(elong, phi, height);
9421 
9422     
9423     }
9424     
9425 
9426     /**
9427     *  Transform geodetic coordinates to geocentric using the specified
9428     *  reference ellipsoid.
9429     *
9430     *<p>This function is derived from the International Astronomical Union's
9431     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9432     *
9433     *<p>Status:  canonical transformation.
9434     *
9435     *<!-- Given: -->
9436     *     @param n        int         ellipsoid identifier (Note 1)
9437     *     @param elong    double      longitude (radians, east +ve)
9438     *     @param phi      double      latitude (geodetic, radians, Note 3)
9439     *     @param height   double      height above ellipsoid (geodetic, Notes 2,3)
9440     *
9441     *<!-- Returned: -->
9442     *     @return xyz      double[3]    <u>returned</u> geocentric vector (Note 2)
9443     *
9444     * <!-- Returned (function value): -->
9445     *  @throws JSOFAIllegalParameter    -1 = illegal identifier (Note 3)
9446     *                         -2 = illegal case (Note 3)
9447     *
9448     * <p>Notes:
9449     * <ol>
9450     *
9451     * <li> The identifier n is a number that specifies the choice of
9452     *     reference ellipsoid.  The following are supported:
9453     *
9454     *        n   ellipsoid
9455     *
9456     *        1    WGS84
9457     *        2    GRS80
9458     *
9459     *     The number n has no significance outside the JSOFA software.
9460     *
9461     * <li> The height (height, given) and the geocentric vector (xyz,
9462     *     returned) are in meters.
9463     *
9464     * <li> No validation is performed on the arguments elong, phi and
9465     *     height.  An error status -1 means that the identifier n is
9466     *     illegal.  An error status -2 protects against cases that would
9467     *     lead to arithmetic exceptions.  In all error cases, xyz is set
9468     *     to zeros.
9469     *
9470     * <li> The inverse transformation is performed in the function jauGc2gd.
9471     *</ol>
9472     *<p>Called:<ul>
9473     *     <li>{@link #jauEform} Earth reference ellipsoids
9474     *     <li>{@link #jauGd2gce} geodetic to geocentric transformation, general
9475     *     <li>{@link #jauZp} zero p-vector
9476     * </ul>
9477     *@version 2010 January 18
9478     *
9479     *  @since Release 20101201
9480     *
9481     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9482     */
9483     public static double[] jauGd2gc ( int n, double elong, double phi, double height ) throws JSOFAIllegalParameter, JSOFAInternalError
9484     {
9485 
9486 
9487     /* Obtain reference ellipsoid parameters. */
9488        ReferenceEllipsoid em = jauEform ( n );
9489 
9490     /* If OK, transform longitude, geodetic latitude, height to x,y,z. */
9491       return jauGd2gce ( em.a, em.f, elong, phi, height );
9492   
9493     
9494     }
9495     
9496 
9497     /**
9498     *  Transform geodetic coordinates to geocentric for a reference
9499     *  ellipsoid of specified form.
9500     *
9501     *<p>This function is derived from the International Astronomical Union's
9502     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9503     *
9504     *<p>Status:  support function.
9505     *
9506     *<!-- Given: -->
9507     *     @param a        double      equatorial radius (Notes 1,4)
9508     *     @param f        double      flattening (Notes 2,4)
9509     *     @param elong    double      longitude (radians, east +ve)
9510     *     @param phi      double      latitude (geodetic, radians, Note 4)
9511     *     @param height   double      height above ellipsoid (geodetic, Notes 3,4)
9512     *
9513     *<!-- Returned: -->
9514     *     @return xyz      double[3]    <u>returned</u> geocentric vector (Note 3)
9515     *
9516     * <!-- Returned (function value): -->
9517     *  
9518     *  @throws JSOFAInternalError  0 = OK
9519     *                           -1 = illegal case (Note 4)
9520     * <p>Notes:
9521     * <ol>
9522     *
9523     * <li> The equatorial radius, a, can be in any units, but meters is
9524     *     the conventional choice.
9525     *
9526     * <li> The flattening, f, is (for the Earth) a value around 0.00335,
9527     *     i.e. around 1/298.
9528     *
9529     * <li> The equatorial radius, a, and the height, height, must be
9530     *     given in the same units, and determine the units of the
9531     *     returned geocentric vector, xyz.
9532     *
9533     * <li> No validation is performed on individual arguments.  The error
9534     *     status -1 protects against (unrealistic) cases that would lead
9535     *     to arithmetic exceptions.  If an error occurs, xyz is unchanged.
9536     *
9537     * <li> The inverse transformation is performed in the function
9538     *     jauGc2gde.
9539     *
9540     * <li> The transformation for a standard ellipsoid (such as WGS84) can
9541     *     more conveniently be performed by calling jauGd2gc,  which uses a
9542     *     numerical code (1 for WGS84) to identify the required a and f
9543     *     values.
9544     *</ol>
9545     *<p>References:
9546     *
9547     *     <p>Green, R.M., Spherical Astronomy, Cambridge University Press,
9548     *     (1985) Section 4.5, p96.
9549     *
9550     *     <p>Explanatory Supplement to the Astronomical Almanac,
9551     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
9552     *     Section 4.22, p202.
9553     *
9554     *@version 2009 November 2
9555     *
9556     *  @since Release 20101201
9557     *
9558     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9559     */
9560     public static double[] jauGd2gce ( double a, double f, double elong, double phi,
9561                     double height ) throws JSOFAInternalError
9562     {
9563        double sp, cp, w, d, ac, as, r;
9564        double xyz[] = new double[3];
9565 
9566 
9567     /* Functions of geodetic latitude. */
9568        sp = sin(phi);
9569        cp = cos(phi);
9570        w = 1.0 - f;
9571        w = w * w;
9572        d = cp*cp + w*sp*sp;
9573        if ( d <= 0.0 ) throw new JSOFAInternalError("illegal combination of arguments d< 0", -1);
9574        ac = a / sqrt(d);
9575        as = w * ac;
9576 
9577     /* Geocentric vector. */
9578        r = (ac + height) * cp;
9579        xyz[0] = r * cos(elong);
9580        xyz[1] = r * sin(elong);
9581        xyz[2] = (as + height) * sp;
9582 
9583     /* Success. */
9584        return xyz;
9585 
9586     
9587     }
9588     
9589 
9590     /**
9591     *  Greenwich mean sidereal time (model consistent with IAU 2000
9592     *  resolutions).
9593     *
9594     *<p>This function is derived from the International Astronomical Union's
9595     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9596     *
9597     *<p>Status:  canonical model.
9598     *
9599     *<!-- Given: -->
9600     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9601     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9602     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
9603     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
9604     *
9605     * <!-- Returned (function value): -->
9606     *  @return double    Greenwich mean sidereal time (radians)
9607     *
9608     * <p>Notes:
9609     * <ol>
9610     *
9611     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
9612     *     Julian Dates, apportioned in any convenient way between the
9613     *     argument pairs.  For example, JD(UT1)=2450123.7 could be expressed in
9614     *     any of these ways, among others:
9615     *<pre>
9616     *            Part A         Part B
9617     *
9618     *         2450123.7           0.0       (JD method)
9619     *         2451545.0       -1421.3       (J2000 method)
9620     *         2400000.5       50123.2       (MJD method)
9621     *         2450123.5           0.2       (date &amp; time method)
9622     *</pre>
9623     *     The JD method is the most natural and convenient to use in
9624     *     cases where the loss of several decimal digits of resolution
9625     *     is acceptable (in the case of UT;  the TT is not at all critical
9626     *     in this respect).  The J2000 and MJD methods are good compromises
9627     *     between resolution and convenience.  For UT, the date &amp; time
9628     *     method is best matched to the algorithm that is used by the Earth
9629     *     Rotation Angle function, called internally:  maximum precision is
9630     *     delivered when the uta argument is for 0hrs UT1 on the day in
9631     *     question and the utb argument lies in the range 0 to 1, or vice
9632     *     versa.
9633     *
9634     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
9635     *     and TT to predict the effects of precession.  If UT1 is used for
9636     *     both purposes, errors of order 100 microarcseconds result.
9637     *
9638     * <li> This GMST is compatible with the IAU 2000 resolutions and must be
9639     *     used only in conjunction with other IAU 2000 compatible
9640     *     components such as precession-nutation and equation of the
9641     *     equinoxes.
9642     *
9643     * <li> The result is returned in the range 0 to 2pi.
9644     *
9645     * <li> The algorithm is from Capitaine et al. (2003) and IERS
9646     *     Conventions 2003.
9647     *</ol>
9648     *<p>Called:<ul>
9649     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
9650     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9651     * </ul>
9652     *<p>References:
9653     *
9654     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
9655     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
9656     *     Astrophysics, 406, 1135-1149 (2003)
9657     *
9658     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
9659     *     IERS Technical Note No. 32, BKG (2004)
9660     *
9661     *@version 2009 March 16
9662     *
9663     *  @since Release 20101201
9664     *
9665     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9666     */
9667     public static double jauGmst00(double uta, double utb, double tta, double ttb)
9668     {
9669        double t, gmst;
9670 
9671 
9672     /* TT Julian centuries since J2000.0. */
9673        t = ((tta - DJ00) + ttb) / DJC;
9674 
9675     /* Greenwich Mean Sidereal Time, IAU 2000. */
9676        gmst = jauAnp(jauEra00(uta, utb) +
9677                        (     0.014506   +
9678                        (  4612.15739966 +
9679                        (     1.39667721 +
9680                        (    -0.00009344 +
9681                        (     0.00001882 )
9682               * t) * t) * t) * t) * DAS2R);
9683 
9684        return gmst;
9685 
9686         }
9687     
9688 
9689     /**
9690     *  Greenwich mean sidereal time (consistent with IAU 2006 precession).
9691     *
9692     *<p>This function is derived from the International Astronomical Union's
9693     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9694     *
9695     *<p>Status:  canonical model.
9696     *
9697     *<!-- Given: -->
9698     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9699     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9700     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
9701     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
9702     *
9703     * <!-- Returned (function value): -->
9704     *  @return double    Greenwich mean sidereal time (radians)
9705     *
9706     * <p>Notes:
9707     * <ol>
9708     *
9709     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
9710     *     Julian Dates, apportioned in any convenient way between the
9711     *     argument pairs.  For example, JD(UT1)=450123.7 could be expressed in
9712     *     any of these ways, among others:
9713     *<pre>
9714     *            u1a              utb
9715     *
9716     *         2450123.7           0.0       (JD method)
9717     *         2451545.0       -1421.3       (J2000 method)
9718     *         2400000.5       50123.2       (MJD method)
9719     *         2450123.5           0.2       (date &amp; time method)
9720     *</pre>
9721     *     The JD method is the most natural and convenient to use in
9722     *     cases where the loss of several decimal digits of resolution
9723     *     is acceptable (in the case of UT;  the TT is not at all critical
9724     *     in this respect).  The J2000 and MJD methods are good compromises
9725     *     between resolution and convenience.  For UT, the date &amp; time
9726     *     method is best matched to the algorithm that is used by the Earth
9727     *     rotation angle function, called internally:  maximum precision is
9728     *     delivered when the uta argument is for 0hrs UT1 on the day in
9729     *     question and the utb argument lies in the range 0 to 1, or vice
9730     *     versa.
9731     *
9732     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
9733     *     and TT to predict the effects of precession.  If UT1 is used for
9734     *     both purposes, errors of order 100 microarcseconds result.
9735     *
9736     * <li> This GMST is compatible with the IAU 2006 precession and must not
9737     *     be used with other precession models.
9738     *
9739     * <li> The result is returned in the range 0 to 2pi.
9740     *</ol>
9741     *<p>Called:<ul>
9742     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
9743     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9744     * </ul>
9745     *<p>Reference:
9746     *
9747     *    <p>Capitaine, N., Wallace, P.T. &amp; Chapront, J., 2005,
9748     *     Astron.Astrophys. 432, 355
9749     *
9750     *@version 2008 May 24
9751     *
9752     *  @since Release 20101201
9753     *
9754     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9755     */
9756     public static double jauGmst06(double uta, double utb, double tta, double ttb)
9757     {
9758        double t, gmst;
9759 
9760 
9761     /* TT Julian centuries since J2000.0. */
9762        t = ((tta - DJ00) + ttb) / DJC;
9763 
9764     /* Greenwich mean sidereal time, IAU 2006. */
9765        gmst = jauAnp(jauEra00(uta, utb) +
9766                       (    0.014506     +
9767                       (  4612.156534    +
9768                       (     1.3915817   +
9769                       (    -0.00000044  +
9770                       (    -0.000029956 +
9771                       (    -0.0000000368 )
9772               * t) * t) * t) * t) * t) * DAS2R);
9773 
9774        return gmst;
9775 
9776         }
9777     
9778 
9779     /**
9780     *  Universal Time to Greenwich mean sidereal time (IAU 1982 model).
9781     *
9782     *<p>This function is derived from the International Astronomical Union's
9783     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9784     *
9785     *<p>Status:  canonical model.
9786     *
9787     *<!-- Given: -->
9788     *     @param dj1 double     UT1 Julian Date (see note)
9789     *     @param dj2 double     UT1 Julian Date (see note) 
9790     *
9791     * <!-- Returned (function value): -->
9792     *  @return double    Greenwich mean sidereal time (radians)
9793     *
9794     * <p>Notes:
9795     * <ol>
9796     *
9797     * <li> The UT1 date dj1+dj2 is a Julian Date, apportioned in any
9798     *     convenient way between the arguments dj1 and dj2.  For example,
9799     *     JD(UT1)=2450123.7 could be expressed in any of these ways,
9800     *     among others:
9801     *<pre>
9802     *             dj1            dj2
9803     *
9804     *         2450123.7D0        0D0        (JD method)
9805     *          2451545D0      -1421.3D0     (J2000 method)
9806     *         2400000.5D0     50123.2D0     (MJD method)
9807     *         2450123.5D0       0.2D0       (date &amp; time method)
9808     *</pre>
9809     *     The JD method is the most natural and convenient to use in
9810     *     cases where the loss of several decimal digits of resolution
9811     *     is acceptable.  The J2000 and MJD methods are good compromises
9812     *     between resolution and convenience.  The date &amp; time method is
9813     *     best matched to the algorithm used:  maximum accuracy (or, at
9814     *     least, minimum noise) is delivered when the dj1 argument is for
9815     *     0hrs UT1 on the day in question and the dj2 argument lies in the
9816     *     range 0 to 1, or vice versa.
9817     *
9818     * <li> The algorithm is based on the IAU 1982 expression.  This is
9819     *     always described as giving the GMST at 0 hours UT1.  In fact, it
9820     *     gives the difference between the GMST and the UT, the steady
9821     *     4-minutes-per-day drawing-ahead of ST with respect to UT.  When
9822     *     whole days are ignored, the expression happens to equal the GMST
9823     *     at 0 hours UT1 each day.
9824     *
9825     * <li> In this function, the entire UT1 (the sum of the two arguments
9826     *     dj1 and dj2) is used directly as the argument for the standard
9827     *     formula, the constant term of which is adjusted by 12 hours to
9828     *     take account of the noon phasing of Julian Date.  The UT1 is then
9829     *     added, but omitting whole days to conserve accuracy.
9830     *</ol>
9831     *<p>Called:<ul>
9832     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9833     * </ul>
9834     *<p>References:
9835     *
9836     *     <p>Transactions of the International Astronomical Union,
9837     *     XVIII B, 67 (1983).
9838     *
9839     *     <p>Aoki et al., Astron. Astrophys. 105, 359-361 (1982).
9840     *
9841     *@version 2008 May 24
9842     *
9843     *  @since Release 20101201
9844     *
9845     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9846     */
9847     public static double jauGmst82(double dj1, double dj2)
9848     {
9849     /* Coefficients of IAU 1982 GMST-UT1 model */
9850        double A = 24110.54841  -  DAYSEC / 2.0;
9851        double B = 8640184.812866;
9852        double C = 0.093104;
9853        double D =  -6.2e-6;
9854 
9855     /* The first constant, A, has to be adjusted by 12 hours */
9856     /* because the UT1 is supplied as a Julian date, which begins  */
9857     /* at noon.                                                    */
9858 
9859        double d1, d2, t, f, gmst;
9860 
9861 
9862     /* Julian centuries since fundamental epoch. */
9863        if (dj1 < dj2) {
9864           d1 = dj1;
9865           d2 = dj2;
9866        } else {
9867           d1 = dj2;
9868           d2 = dj1;
9869        }
9870        t = (d1 + (d2 - DJ00)) / DJC;
9871 
9872     /* Fractional part of JD(UT1), in seconds. */
9873        f = DAYSEC * (fmod(d1, 1.0) + fmod(d2, 1.0));
9874 
9875     /* GMST at this UT1. */
9876        gmst = jauAnp(DS2R * ((A + (B + (C + D * t) * t) * t) + f));
9877 
9878        return gmst;
9879 
9880         }
9881     
9882 
9883     /**
9884     *  Greenwich apparent sidereal time (consistent with IAU 2000
9885     *  resolutions).
9886     *
9887     *<p>This function is derived from the International Astronomical Union's
9888     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9889     *
9890     *<p>Status:  canonical model.
9891     *
9892     *<!-- Given: -->
9893     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9894     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9895     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
9896     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
9897     *
9898     * <!-- Returned (function value): -->
9899     *  @return double    Greenwich apparent sidereal time (radians)
9900     *
9901     * <p>Notes:
9902     * <ol>
9903     *
9904     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
9905     *     Julian Dates, apportioned in any convenient way between the
9906     *     argument pairs.  For example, JD=2450123.7 could be expressed in
9907     *     any of these ways, among others:
9908     *<pre>
9909     *            Part A        Part B
9910     *
9911     *         2450123.7           0.0       (JD method)
9912     *         2451545.0       -1421.3       (J2000 method)
9913     *         2400000.5       50123.2       (MJD method)
9914     *         2450123.5           0.2       (date &amp; time method)
9915     *</pre>
9916     *     The JD method is the most natural and convenient to use in
9917     *     cases where the loss of several decimal digits of resolution
9918     *     is acceptable (in the case of UT;  the TT is not at all critical
9919     *     in this respect).  The J2000 and MJD methods are good compromises
9920     *     between resolution and convenience.  For UT, the date &amp; time
9921     *     method is best matched to the algorithm that is used by the Earth
9922     *     Rotation Angle function, called internally:  maximum precision is
9923     *     delivered when the uta argument is for 0hrs UT1 on the day in
9924     *     question and the utb argument lies in the range 0 to 1, or vice
9925     *     versa.
9926     *
9927     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
9928     *     and TT to predict the effects of precession-nutation.  If UT1 is
9929     *     used for both purposes, errors of order 100 microarcseconds
9930     *     result.
9931     *
9932     * <li> This GAST is compatible with the IAU 2000 resolutions and must be
9933     *     used only in conjunction with other IAU 2000 compatible
9934     *     components such as precession-nutation.
9935     *
9936     * <li> The result is returned in the range 0 to 2pi.
9937     *
9938     * <li> The algorithm is from Capitaine et al. (2003) and IERS
9939     *     Conventions 2003.
9940     *</ol>
9941     *<p>Called:<ul>
9942     *     <li>{@link #jauGmst00} Greenwich mean sidereal time, IAU 2000
9943     *     <li>{@link #jauEe00a} equation of the equinoxes, IAU 2000A
9944     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9945     * </ul>
9946     *<p>References:
9947     *
9948     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
9949     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
9950     *     Astrophysics, 406, 1135-1149 (2003)
9951     *
9952     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
9953     *     IERS Technical Note No. 32, BKG (2004)
9954     *
9955     *@version 2008 May 16
9956     *
9957     *  @since Release 20101201
9958     *
9959     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9960     */
9961     public static double jauGst00a(double uta, double utb, double tta, double ttb)
9962     {
9963        double gmst00, ee00a, gst;
9964 
9965 
9966        gmst00 = jauGmst00(uta, utb, tta, ttb);
9967        ee00a = jauEe00a(tta, ttb);
9968        gst = jauAnp(gmst00 + ee00a);
9969 
9970        return gst;
9971 
9972         }
9973     
9974 
9975     /**
9976     *  Greenwich apparent sidereal time (consistent with IAU 2000
9977     *  resolutions but using the truncated nutation model IAU 2000B).
9978     *
9979     *<p>This function is derived from the International Astronomical Union's
9980     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9981     *
9982     *<p>Status:  support function.
9983     *
9984     *<!-- Given: -->
9985     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9986     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9987     *
9988     * <!-- Returned (function value): -->
9989     *  @return double    Greenwich apparent sidereal time (radians)
9990     *
9991     * <p>Notes:
9992     * <ol>
9993     *
9994     * <li> The UT1 date uta+utb is a Julian Date, apportioned in any
9995     *     convenient way between the argument pair.  For example,
9996     *     JD=2450123.7 could be expressed in any of these ways, among
9997     *     others:
9998     *<pre>
9999     *             uta            utb
10000     *
10001     *         2450123.7           0.0       (JD method)
10002     *         2451545.0       -1421.3       (J2000 method)
10003     *         2400000.5       50123.2       (MJD method)
10004     *         2450123.5           0.2       (date &amp; time method)
10005     *</pre>
10006     *     The JD method is the most natural and convenient to use in cases
10007     *     where the loss of several decimal digits of resolution is
10008     *     acceptable.  The J2000 and MJD methods are good compromises
10009     *     between resolution and convenience.  For UT, the date &amp; time
10010     *     method is best matched to the algorithm that is used by the Earth
10011     *     Rotation Angle function, called internally:  maximum precision is
10012     *     delivered when the uta argument is for 0hrs UT1 on the day in
10013     *     question and the utb argument lies in the range 0 to 1, or vice
10014     *     versa.
10015     *
10016     * <li> The result is compatible with the IAU 2000 resolutions, except
10017     *     that accuracy has been compromised for the sake of speed and
10018     *     convenience in two respects:
10019     *
10020     *     . UT is used instead of TDB (or TT) to compute the precession
10021     *       component of GMST and the equation of the equinoxes.  This
10022     *       results in errors of order 0.1 mas at present.
10023     *
10024     *     . The IAU 2000B abridged nutation model (McCarthy &amp; Luzum, 2003)
10025     *       is used, introducing errors of up to 1 mas.
10026     *
10027     * <li> This GAST is compatible with the IAU 2000 resolutions and must be
10028     *     used only in conjunction with other IAU 2000 compatible
10029     *     components such as precession-nutation.
10030     *
10031     * <li> The result is returned in the range 0 to 2pi.
10032     *
10033     * <li> The algorithm is from Capitaine et al. (2003) and IERS
10034     *     Conventions 2003.
10035     *</ol>
10036     *<p>Called:<ul>
10037     *     <li>{@link #jauGmst00} Greenwich mean sidereal time, IAU 2000
10038     *     <li>{@link #jauEe00b} equation of the equinoxes, IAU 2000B
10039     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10040     * </ul>
10041     *<p>References:
10042     *
10043     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
10044     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
10045     *     Astrophysics, 406, 1135-1149 (2003)
10046     *
10047     *     <p>McCarthy, D.D. &amp; Luzum, B.J., "An abridged model of the
10048     *     precession-nutation of the celestial pole", Celestial Mechanics &amp;
10049     *     Dynamical Astronomy, 85, 37-49 (2003)
10050     *
10051     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
10052     *     IERS Technical Note No. 32, BKG (2004)
10053     *
10054     *@version 2008 May 16
10055     *
10056     *  @since Release 20101201
10057     *
10058     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10059     */
10060     public static double jauGst00b(double uta, double utb)
10061     {
10062        double gmst00, ee00b, gst;
10063 
10064 
10065        gmst00 = jauGmst00(uta, utb, uta, utb);
10066        ee00b = jauEe00b(uta, utb);
10067        gst = jauAnp(gmst00 + ee00b);
10068 
10069        return gst;
10070 
10071         }
10072     
10073 
10074     /**
10075     *  Greenwich apparent sidereal time, IAU 2006, given the NPB matrix.
10076     *
10077     *<p>This function is derived from the International Astronomical Union's
10078     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10079     *
10080     *<p>Status:  support function.
10081     *
10082     *<!-- Given: -->
10083     *     @param uta double         UT1 as a 2-part Julian Date (Notes 1,2)
10084     *     @param utb double         UT1 as a 2-part Julian Date (Notes 1,2) 
10085     *     @param tta double         TT as a 2-part Julian Date (Notes 1,2)
10086     *     @param ttb double         TT as a 2-part Julian Date (Notes 1,2) 
10087     *     @param rnpb      double[3][3]   nutation x precession x bias matrix
10088     *
10089     * <!-- Returned (function value): -->
10090     *  @return double        Greenwich apparent sidereal time (radians)
10091     *
10092     * <p>Notes:
10093     * <ol>
10094     *
10095     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
10096     *     Julian Dates, apportioned in any convenient way between the
10097     *     argument pairs.  For example, JD=2450123.7 could be expressed in
10098     *     any of these ways, among others:
10099     *<pre>
10100     *            uta              utb
10101     *
10102     *         2450123.7           0.0       (JD method)
10103     *         2451545.0       -1421.3       (J2000 method)
10104     *         2400000.5       50123.2       (MJD method)
10105     *         2450123.5           0.2       (date &amp; time method)
10106     *</pre>
10107     *     The JD method is the most natural and convenient to use in
10108     *     cases where the loss of several decimal digits of resolution
10109     *     is acceptable (in the case of UT;  the TT is not at all critical
10110     *     in this respect).  The J2000 and MJD methods are good compromises
10111     *     between resolution and convenience.  For UT, the date &amp; time
10112     *     method is best matched to the algorithm that is used by the Earth
10113     *     rotation angle function, called internally:  maximum precision is
10114     *     delivered when the uta argument is for 0hrs UT1 on the day in
10115     *     question and the utb argument lies in the range 0 to 1, or vice
10116     *     versa.
10117     *
10118     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
10119     *     and TT to predict the effects of precession-nutation.  If UT1 is
10120     *     used for both purposes, errors of order 100 microarcseconds
10121     *     result.
10122     *
10123     * <li> Although the function uses the IAU 2006 series for s+XY/2, it is
10124     *     otherwise independent of the precession-nutation model and can in
10125     *     practice be used with any equinox-based NPB matrix.
10126     *
10127     * <li> The result is returned in the range 0 to 2pi.
10128     *</ol>
10129     *<p>Called:<ul>
10130     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
10131     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
10132     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10133     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
10134     *     <li>{@link #jauEors} equation of the origins, given NPB matrix and s
10135     * </ul>
10136     *<p>Reference:
10137     *
10138     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
10139     *
10140     *@version 2008 May 24
10141     *
10142     *  @since Release 20101201
10143     *
10144     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10145     */
10146     public static double jauGst06(double uta, double utb, double tta, double ttb,
10147                     double rnpb[][])
10148     {
10149        double s, era, eors, gst;
10150 
10151 
10152     /* Extract CIP coordinates. */
10153        CelestialIntermediatePole cip = jauBpn2xy(rnpb);
10154 
10155     /* The CIO locator, s. */
10156        s = jauS06(tta, ttb, cip.x, cip.y);
10157 
10158     /* Greenwich apparent sidereal time. */
10159        era = jauEra00(uta, utb);
10160        eors = jauEors(rnpb, s);
10161        gst = jauAnp(era - eors);
10162 
10163        return gst;
10164 
10165         }
10166     
10167 
10168     /**
10169     *  Greenwich apparent sidereal time (consistent with IAU 2000 and 2006
10170     *  resolutions).
10171     *
10172     *<p>This function is derived from the International Astronomical Union's
10173     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10174     *
10175     *<p>Status:  canonical model.
10176     *
10177     *<!-- Given: -->
10178     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
10179     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
10180     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
10181     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
10182     *
10183     * <!-- Returned (function value): -->
10184     *  @return double    Greenwich apparent sidereal time (radians)
10185     *
10186     * <p>Notes:
10187     * <ol>
10188     *
10189     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
10190     *     Julian Dates, apportioned in any convenient way between the
10191     *     argument pairs.  For example, JD=2450123.7 could be expressed in
10192     *     any of these ways, among others:
10193     *<pre>
10194     *            uta             utb
10195     *
10196     *         2450123.7           0.0       (JD method)
10197     *         2451545.0       -1421.3       (J2000 method)
10198     *         2400000.5       50123.2       (MJD method)
10199     *         2450123.5           0.2       (date &amp; time method)
10200     *</pre>
10201     *     The JD method is the most natural and convenient to use in
10202     *     cases where the loss of several decimal digits of resolution
10203     *     is acceptable (in the case of UT;  the TT is not at all critical
10204     *     in this respect).  The J2000 and MJD methods are good compromises
10205     *     between resolution and convenience.  For UT, the date &amp; time
10206     *     method is best matched to the algorithm that is used by the Earth
10207     *     rotation angle function, called internally:  maximum precision is
10208     *     delivered when the uta argument is for 0hrs UT1 on the day in
10209     *     question and the utb argument lies in the range 0 to 1, or vice
10210     *     versa.
10211     *
10212     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
10213     *     and TT to predict the effects of precession-nutation.  If UT1 is
10214     *     used for both purposes, errors of order 100 microarcseconds
10215     *     result.
10216     *
10217     * <li> This GAST is compatible with the IAU 2000/2006 resolutions and
10218     *     must be used only in conjunction with IAU 2006 precession and
10219     *     IAU 2000A nutation.
10220     *
10221     * <li> The result is returned in the range 0 to 2pi.
10222     *</ol>
10223     *<p>Called:<ul>
10224     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
10225     *     <li>{@link #jauGst06} Greenwich apparent ST, IAU 2006, given NPB matrix
10226     * </ul>
10227     *<p>Reference:
10228     *
10229     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
10230     *
10231     *@version 2008 May 16
10232     *
10233     *  @since Release 20101201
10234     *
10235     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10236     */
10237     public static double jauGst06a(double uta, double utb, double tta, double ttb)
10238     {
10239        double rnpb[][], gst;
10240 
10241 
10242     /* Classical nutation x precession x bias matrix, IAU 2000A. */
10243        rnpb = jauPnm06a(tta, ttb);
10244 
10245     /* Greenwich apparent sidereal time. */
10246        gst = jauGst06(uta, utb, tta, ttb, rnpb);
10247 
10248        return gst;
10249 
10250         }
10251     
10252 
10253     /**
10254     *  Greenwich apparent sidereal time (consistent with IAU 1982/94
10255     *  resolutions).
10256     *
10257     *<p>This function is derived from the International Astronomical Union's
10258     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10259     *
10260     *<p>Status:  support function.
10261     *
10262     *<!-- Given: -->
10263     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
10264     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
10265     *
10266     * <!-- Returned (function value): -->
10267     *  @return double    Greenwich apparent sidereal time (radians)
10268     *
10269     * <p>Notes:
10270     * <ol>
10271     *
10272     * <li> The UT1 date uta+utb is a Julian Date, apportioned in any
10273     *     convenient way between the argument pair.  For example,
10274     *     JD=2450123.7 could be expressed in any of these ways, among
10275     *     others:
10276     *<pre>
10277     *             uta            utb
10278     *
10279     *         2450123.7           0.0       (JD method)
10280     *         2451545.0       -1421.3       (J2000 method)
10281     *         2400000.5       50123.2       (MJD method)
10282     *         2450123.5           0.2       (date &amp; time method)
10283     *</pre>
10284     *     The JD method is the most natural and convenient to use in cases
10285     *     where the loss of several decimal digits of resolution is
10286     *     acceptable.  The J2000 and MJD methods are good compromises
10287     *     between resolution and convenience.  For UT, the date &amp; time
10288     *     method is best matched to the algorithm that is used by the Earth
10289     *     Rotation Angle function, called internally:  maximum precision is
10290     *     delivered when the uta argument is for 0hrs UT1 on the day in
10291     *     question and the utb argument lies in the range 0 to 1, or vice
10292     *     versa.
10293     *
10294     * <li> The result is compatible with the IAU 1982 and 1994 resolutions,
10295     *     except that accuracy has been compromised for the sake of
10296     *     convenience in that UT is used instead of TDB (or TT) to compute
10297     *     the equation of the equinoxes.
10298     *
10299     * <li> This GAST must be used only in conjunction with contemporaneous
10300     *     IAU standards such as 1976 precession, 1980 obliquity and 1982
10301     *     nutation.  It is not compatible with the IAU 2000 resolutions.
10302     *
10303     * <li> The result is returned in the range 0 to 2pi.
10304     *</ol>
10305     *<p>Called:<ul>
10306     *     <li>{@link #jauGmst82} Greenwich mean sidereal time, IAU 1982
10307     *     <li>{@link #jauEqeq94} equation of the equinoxes, IAU 1994
10308     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10309     * </ul>
10310     *<p>References:
10311     *
10312     *     <p>Explanatory Supplement to the Astronomical Almanac,
10313     *     P. Kenneth Seidelmann (ed), University Science Books (1992)
10314     *
10315     *     IAU Resolution C7, Recommendation 3 (1994)
10316     *
10317     *@version 2008 May 16
10318     *
10319     *  @since Release 20101201
10320     *
10321     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10322     */
10323     public static double jauGst94(double uta, double utb)
10324     {
10325        double gmst82, eqeq94, gst;
10326 
10327 
10328        gmst82 = jauGmst82(uta, utb);
10329        eqeq94 = jauEqeq94(uta, utb);
10330        gst = jauAnp(gmst82  + eqeq94);
10331 
10332        return gst;
10333 
10334         }
10335     
10336 
10337     /**
10338     *  Transform Hipparcos star data into the FK5 (J2000.0) system.
10339     *
10340     *<p>This function is derived from the International Astronomical Union's
10341     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10342     *
10343     *<p>Status:  support function.
10344     *
10345     *  Given (all Hipparcos, epoch J2000.0):
10346     *    @param rh      double    RA (radians)
10347     *    @param dh      double    Dec (radians)
10348     *    @param drh     double    proper motion in RA (dRA/dt, rad/Jyear)
10349     *    @param ddh     double    proper motion in Dec (dDec/dt, rad/Jyear)
10350     *    @param pxh     double    parallax (arcsec)
10351     *    @param rvh     double    radial velocity (km/s, positive = receding)
10352     *
10353     *  @return cc CatalogCoords all FK5, equinox J2000.0, epoch J2000.0:
10354     *
10355     * <p>Notes:
10356     * <ol>
10357     *
10358     * <li> This function transforms Hipparcos star positions and proper
10359     *     motions into FK5 J2000.0.
10360     *
10361     * <li> The proper motions in RA are dRA/dt rather than
10362     *     cos(Dec)*dRA/dt, and are per year rather than per century.
10363     *
10364     * <li> The FK5 to Hipparcos transformation is modeled as a pure
10365     *     rotation and spin;  zonal errors in the FK5 catalog are not
10366     *     taken into account.
10367     *
10368     * <li> See also jauFk52h, jauFk5hz, jauHfk5z.
10369     *</ol>
10370     *<p>Called:<ul>
10371     *     <li>{@link #jauStarpv} star catalog data to space motion pv-vector
10372     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
10373     *     <li>{@link #jauRv2m} r-vector to r-matrix
10374     *     <li>{@link #jauRxp} product of r-matrix and p-vector
10375     *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
10376     *     <li>{@link #jauPxp} vector product of two p-vectors
10377     *     <li>{@link #jauPmp} p-vector minus p-vector
10378     *     <li>{@link #jauPvstar} space motion pv-vector to star catalog data
10379     * </ul>
10380     *<p>Reference:
10381     *
10382     *     <p>F.Mignard &amp; M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
10383     *
10384     *@version 2009 December 17
10385     *
10386     *  @since Release 20101201
10387     *
10388     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10389     */
10390     public static CatalogCoords jauH2fk5(double rh, double dh,
10391                   double drh, double ddh, double pxh, double rvh)
10392     {
10393        int i;
10394        double pvh[][] = new double[2][3], r5h[][] = new double[3][3], s5h[] = new double[3], sh[] = new double[3], wxp[] = new double[3], vv[] = new double[3], pv5[][] = new double[2][3];
10395 
10396 
10397     /* Hipparcos barycentric position/velocity pv-vector (normalized). */
10398        jauStarpv(rh, dh, drh, ddh, pxh, rvh, pvh);
10399 
10400     /* FK5 to Hipparcos orientation matrix and spin vector. */
10401        jauFk5hip(r5h, s5h);
10402 
10403     /* Make spin units per day instead of per year. */
10404        for ( i = 0; i < 3; s5h[i++] /= 365.25 );
10405 
10406     /* Orient the spin into the Hipparcos system. */
10407        sh = jauRxp(r5h, s5h);
10408 
10409     /* De-orient the Hipparcos position into the FK5 system. */
10410        pv5[0] = jauTrxp(r5h, pvh[0]);
10411 
10412     /* Apply spin to the position giving an extra space motion component. */
10413        wxp = jauPxp(pvh[0],sh);
10414 
10415     /* Subtract this component from the Hipparcos space motion. */
10416        vv = jauPmp(pvh[1], wxp);
10417 
10418     /* De-orient the Hipparcos space motion into the FK5 system. */
10419        pv5[1] = jauTrxp(r5h, vv);
10420 
10421     /* FK5 pv-vector to spherical., r5, d5, dr5, dd5, px5, rv5 */
10422        CatalogCoords cat = null;
10423        try {
10424            cat = jauPvstar(pv5);
10425        } catch (JSOFAInternalError e) {
10426            // original code just ignored this possibility
10427            e.printStackTrace();
10428        }
10429 
10430        return cat;
10431 
10432         }
10433     
10434 
10435     /**
10436     *  Transform a Hipparcos star position into FK5 J2000.0, assuming
10437     *  zero Hipparcos proper motion.
10438     *
10439     *<p>This function is derived from the International Astronomical Union's
10440     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10441     *
10442     *<p>Status:  support function.
10443     *
10444     *<!-- Given: -->
10445     *     @param rh             double     Hipparcos RA (radians)
10446     *     @param dh             double     Hipparcos Dec (radians)
10447     *     @param date1 double     TDB date (Note 1)
10448     *     @param date2 double     TDB date (Note 1) 
10449     *
10450     * FIXME original did not return the parallax and radial velocity of the CatalogCoords type.
10451     *  @return cc CatalogCoords (all FK5, equinox J2000.0, date date1+date2)
10452     *        RA (radians),  Dec (radians), FK5 RA proper motion (rad/year, Note 4), Dec proper motion (rad/year, Note 4)
10453     *
10454     * <p>Notes:
10455     * <ol>
10456     *
10457     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
10458     *     convenient way between the two arguments.  For example,
10459     *     JD(TT)=2450123.7 could be expressed in any of these ways,
10460     *     among others:
10461     *<pre>
10462     *            date1          date2
10463     *
10464     *         2450123.7           0.0       (JD method)
10465     *         2451545.0       -1421.3       (J2000 method)
10466     *         2400000.5       50123.2       (MJD method)
10467     *         2450123.5           0.2       (date &amp; time method)
10468     *</pre>
10469     *     The JD method is the most natural and convenient to use in
10470     *     cases where the loss of several decimal digits of resolution
10471     *     is acceptable.  The J2000 method is best matched to the way
10472     *     the argument is handled internally and will deliver the
10473     *     optimum resolution.  The MJD method and the date &amp; time methods
10474     *     are both good compromises between resolution and convenience.
10475     *
10476     * <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
10477     *
10478     * <li> The FK5 to Hipparcos transformation is modeled as a pure rotation
10479     *     and spin;  zonal errors in the FK5 catalogue are not taken into
10480     *     account.
10481     *
10482     * <li> It was the intention that Hipparcos should be a close
10483     *     approximation to an inertial frame, so that distant objects have
10484     *     zero proper motion;  such objects have (in general) non-zero
10485     *     proper motion in FK5, and this function returns those fictitious
10486     *     proper motions.
10487     *
10488     * <li> The position returned by this function is in the FK5 J2000.0
10489     *     reference system but at date date1+date2.
10490     *
10491     * <li> See also jauFk52h, jauH2fk5, jauFk5hz.
10492     *</ol>
10493     *<p>Called:<ul>
10494     *     <li>{@link #jauS2c} spherical coordinates to unit vector
10495     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
10496     *     <li>{@link #jauRxp} product of r-matrix and p-vector
10497     *     <li>{@link #jauSxp} multiply p-vector by scalar
10498     *     <li>{@link #jauRxr} product of two r-matrices
10499     *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
10500     *     <li>{@link #jauPxp} vector product of two p-vectors
10501     *     <li>{@link #jauPv2s} pv-vector to spherical
10502     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10503     * </ul>
10504     *<p>Reference:
10505     *
10506     *     <p>F.Mignard &amp; M.Froeschle, 2000, Astron.Astrophys. 354, 732-739.
10507     *
10508     *@version 2009 December 17
10509     *
10510     *  @since Release 20101201
10511     *
10512     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10513     *
10514     */
10515     public static CatalogCoords jauHfk5z(double rh, double dh, double date1, double date2)
10516     {
10517        double t, ph[] = new double[3], r5h[][] = new double[3][3], s5h[] = new double[3], sh[] = new double[3], vst[] = new double[3],
10518        rst[][] = new double[3][3], r5ht[][] = new double[3][3], pv5e[][] = new double[2][3], vv[] = new double[3];
10519 
10520 
10521     /* Time interval from fundamental epoch J2000.0 to given date (JY). */
10522        t = ((date1 - DJ00) + date2) / DJY;
10523 
10524     /* Hipparcos barycentric position vector (normalized). */
10525        ph = jauS2c(rh,dh);
10526 
10527     /* FK5 to Hipparcos orientation matrix and spin vector. */
10528        jauFk5hip(r5h, s5h);
10529 
10530     /* Rotate the spin into the Hipparcos system. */
10531        sh = jauRxp(r5h, s5h);
10532 
10533     /* Accumulated Hipparcos wrt FK5 spin over that interval. */
10534        vst = jauSxp(t,s5h);
10535 
10536     /* Express the accumulated spin as a rotation matrix. */
10537        rst = jauRv2m(vst);
10538 
10539     /* Rotation matrix:  accumulated spin, then FK5 to Hipparcos. */
10540        r5ht = jauRxr(r5h, rst);
10541 
10542     /* De-orient &amp; de-spin the Hipparcos position into FK5 J2000.0. */
10543        pv5e[0] = jauTrxp(r5ht, ph);
10544 
10545     /* Apply spin to the position giving a space motion. */
10546        vv = jauPxp(sh,ph);
10547 
10548     /* De-orient &amp; de-spin the Hipparcos space motion into FK5 J2000.0. */
10549        pv5e[1] = jauTrxp(r5ht, vv);
10550 
10551     /* FK5 position/velocity pv-vector to spherical. */
10552        SphericalPositionVelocity pvs = jauPv2s(pv5e);
10553        double r5 = jauAnp(pvs.pos.theta);
10554 
10555        return new CatalogCoords(r5, pvs.pos.phi, pvs.vel.theta, pvs.vel.phi, 0.0, 0.0);
10556 
10557         }
10558     
10559 
10560     /**
10561     *  Initialize an r-matrix to the identity matrix.
10562     *
10563     *<p>This function is derived from the International Astronomical Union's
10564     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10565     *
10566     *<p>Status:  vector/matrix support function.
10567     *
10568     *<!-- Returned: -->
10569     *     @param r        double[3][3]      <u>returned</u> r-matrix
10570     *
10571     *<p>Called:<ul>
10572     *     <li>{@link #jauZr} zero r-matrix
10573     * </ul>
10574     *@version 2008 May 11
10575     *
10576     *  @since Release 20101201
10577     *
10578     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10579     *  TODO - this would be better returning a new array in java....
10580     */
10581     public static void jauIr(double r[][])
10582     {
10583         jauZr(r);
10584         r[0][0] = 1.0;
10585         r[1][1] = 1.0;
10586         r[2][2] = 1.0;
10587 
10588         return;
10589 
10590     }
10591 
10592     /**
10593      * return a new r-matrix as the identity matrix.
10594      * This is a convenience method that is an 
10595      * overload of the official SOFA API {@link #jauIr(double[][])} that does not require 
10596      * the vector to be passed in.
10597      * @return r        double[3][3]  
10598      */
10599     public static double[][] jauIr()
10600     {
10601         double [][] r = new double[3][3];
10602         jauZr(r);
10603         return r ;
10604 
10605     }
10606 
10607 
10608     /**
10609     *  Julian Date to Gregorian year, month, day, and fraction of a day.
10610     *
10611     *<p>This function is derived from the International Astronomical Union's
10612     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10613     *
10614     *<p>Status:  support function.
10615     *
10616     *<!-- Given: -->
10617     *     @param dj1 double    Julian Date (Notes 1, 2)
10618     *     @param dj2 double    Julian Date (Notes 1, 2) 
10619     *
10620     *  Returned (arguments):
10621     *     iy        int      year
10622     *     im        int      month
10623     *     id        int      day
10624     *     fd        double   fraction of day
10625     *
10626     * <!-- Returned (function value): -->
10627     *  @return Calendar the date represented in Java. 
10628     *
10629     *@throws JSOFAIllegalParameter unacceptable date (Note 3)
10630     * <p>Notes:
10631     * <ol>
10632     *
10633     * <li> The earliest valid date is -68569.5 (-4900 March 1).  The
10634     *     largest value accepted is 10^9.
10635     *
10636     * <li> The Julian Date is apportioned in any convenient way between
10637     *     the arguments dj1 and dj2.  For example, JD=2450123.7 could
10638     *     be expressed in any of these ways, among others:
10639     *<pre>
10640     *            dj1             dj2
10641     *
10642     *         2450123.7           0.0       (JD method)
10643     *         2451545.0       -1421.3       (J2000 method)
10644     *         2400000.5       50123.2       (MJD method)
10645     *         2450123.5           0.2       (date &amp; time method)
10646     *</pre>
10647     *     Separating integer and fraction uses the "compensated summation"
10648     *     algorithm of Kahan-Neumaier to preserve as much precision as
10649     *     possible irrespective of the jd1+jd2 apportionment.
10650     *     
10651     * <li> In early eras the conversion is from the "proleptic Gregorian
10652     *     calendar";  no account is taken of the date(s) of adoption of
10653     *     the Gregorian calendar, nor is the AD/BC numbering convention
10654     *     observed.
10655     *</ol>
10656     *<p>Reference:
10657     *
10658     *     <p>Explanatory Supplement to the Astronomical Almanac,
10659     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10660     *     Section 12.92 (p604).
10661     *     <p> Klein, A., A Generalized Kahan-Babuska-Summation-Algorithm.
10662     *         Computing 76, 279-293 (2006), Section 3.
10663     *
10664     *   @version 2020 Nov 13
10665     *
10666     *  @since Release 20101201
10667     *
10668     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10669     */
10670     public static Calendar jauJd2cal(double dj1, double dj2) throws JSOFAIllegalParameter
10671     {
10672         /* Minimum and maximum allowed JD */
10673         final double djmin = -68569.5;
10674         final double djmax = 1e9;
10675 
10676         long jd, i , l, n,  k;
10677         double dj, f1, f2, d, s, cs, v[]=new double[2], x, t, f;
10678 
10679 
10680         /* Verify date is acceptable. */
10681         dj = dj1 + dj2;
10682         if (dj < djmin || dj > djmax) throw new JSOFAIllegalParameter("input julian date out of range", -1);
10683 
10684         /* Separate day and fraction (where -0.5 <= fraction < 0.5). */
10685         d = dnint(dj1);
10686         f1 = dj1 - d;
10687         jd = (long) d;
10688         d = dnint(dj2);
10689         f2 = dj2 - d;
10690         jd += (long) d;
10691 
10692         /* Compute f1+f2+0.5 using compensated summation (Klein 2006). */
10693         s = 0.5;
10694         cs = 0.0;
10695         v[0] = f1;
10696         v[1] = f2;
10697         for ( int i1 = 0; i1 < 2; i1++ ) {
10698             x = v[i1];
10699             t = s + x;
10700             cs += abs(s) >= abs(x) ? (s-t) + x : (x-t) + s;
10701             s = t;
10702             if ( s >= 1.0 ) {
10703                 jd++;
10704                 s -= 1.0;
10705             }
10706         }
10707         f = s + cs;
10708         cs = f - s;
10709 
10710         /* Deal with negative f. */
10711         if ( f < 0.0 ) {
10712 
10713             /* Compensated summation: assume that |s| <= 1.0. */
10714             f = s + 1.0;
10715             cs += (1.0-f) + s;
10716             s  = f;
10717             f = s + cs;
10718             cs = f - s;
10719             jd--;
10720         }
10721 
10722         /* Deal with f that is 1.0 or more (when rounded to double). */
10723         if ( (f-1.0) >= -DBL_EPSILON/4.0 ) {
10724 
10725             /* Compensated summation: assume that |s| <= 1.0. */
10726             t = s - 1.0;
10727             cs += (s-t) - 1.0;
10728             s = t;
10729             f = s + cs;
10730             if ( -DBL_EPSILON/2.0 < f ) {
10731                 jd++;
10732                 f = gmax(f, 0.0);
10733             }
10734         }
10735 
10736         /* Express day in Gregorian calendar. */
10737        l = jd + 68569L;
10738        n = (4L * l) / 146097L;
10739        l -= (146097L * n + 3L) / 4L;
10740        i = (4000L * (l + 1L)) / 1461001L;
10741        l -= (1461L * i) / 4L - 31L;
10742        k = (80L * l) / 2447L;
10743        int id = (int) (l - (2447L * k) / 80L);
10744        l = k / 11L;
10745        int im = (int) (k + 2L - 12L * l);
10746        int iy = (int) (100L * (n - 49L) + i + l);
10747       
10748 
10749        return new Calendar(iy, im, id, f);
10750 
10751         }
10752      
10753     /**
10754      *  larger (most +ve) of two numbers (generic).
10755      * @param A
10756      * @param B
10757      * @return
10758      */
10759     private static double gmax(double A, double B) {
10760           return (((A)>(B))?(A):(B)) ;      
10761     }
10762 
10763     /**
10764     *  Julian Date to Gregorian Calendar, expressed in a form convenient
10765     *  for formatting messages:  rounded to a specified precision.
10766     *
10767     *<p>This function is derived from the International Astronomical Union's
10768     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10769     *
10770     *<p>Status:  support function.
10771     *
10772     *<!-- Given: -->
10773     *     @param ndp        int       number of decimal places of days in fraction
10774     *     @param dj1 double    dj1+dj2 = Julian Date (Note 1)
10775     *     @param dj2 double    dj1+dj2 = Julian Date (Note 1) 
10776     *
10777     *<!-- Returned: -->
10778     *     @param iymdf      int[4]     <u>returned</u> year, month, day, fraction in Gregorian calendar
10779     *
10780     *
10781     * <!-- Returned (function value): -->
10782     *  @return int      status:
10783     *                          -1 = date out of range
10784     *                           0 = OK
10785     *                          +1 = NDP not 0-9 (interpreted as 0)
10786     *
10787     * <p>Notes:
10788     * <ol>
10789     *
10790     * <li> The Julian Date is apportioned in any convenient way between
10791     *     the arguments dj1 and dj2.  For example, JD=2450123.7 could
10792     *     be expressed in any of these ways, among others:
10793     *<pre>
10794     *             dj1            dj2
10795     *
10796     *         2450123.7           0.0       (JD method)
10797     *         2451545.0       -1421.3       (J2000 method)
10798     *         2400000.5       50123.2       (MJD method)
10799     *         2450123.5           0.2       (date &amp; time method)
10800     *</pre>
10801     * <li> In early eras the conversion is from the "Proleptic Gregorian
10802     *     Calendar";  no account is taken of the date(s) of adoption of
10803     *     the Gregorian Calendar, nor is the AD/BC numbering convention
10804     *     observed.
10805     *
10806     * <li> Refer to the function jauJd2cal.
10807     *
10808     * <li> the number of decimal places (npd) should be 4 or less if internal overflows are to be
10809     *     avoided on machines which use 16-bit integers.
10810     *</ol>
10811     *<p>Called:<ul>
10812     *     <li>{@link #jauJd2cal} JD to Gregorian calendar
10813     * </ul>
10814     *<p>Reference:
10815     *
10816     *     <p>Explanatory Supplement to the Astronomical Almanac,
10817     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10818     *     Section 12.92 (p604).
10819     *
10820     * @version 2020 Nov 13
10821     *
10822     *  @since Release 20101201
10823     *
10824     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10825     */
10826     public static int jauJdcalf(int ndp, double dj1, double dj2, int iymdf[])
10827     {
10828         int j;
10829         double denom, d1, d2, f1, f2, d, djd, f, rf;
10830 
10831 
10832         /* Denominator of fraction (e.g. 100 for 2 decimal places). */
10833         if ((ndp >= 0) && (ndp <= 9)) {
10834             j = 0;
10835             denom = pow(10.0, ndp);
10836         } else {
10837             j = 1;
10838             denom = 1.0;
10839         }
10840 
10841         /* Copy the date, big then small. */
10842         if (abs(dj1) >= abs(dj2)) {
10843             d1 = dj1;
10844             d2 = dj2;
10845         } else {
10846             d1 = dj2;
10847             d2 = dj1;
10848         }
10849 
10850         /* Realign to midnight (without rounding error). */
10851         d1 -= 0.5;
10852 
10853         /* Separate day and fraction (as precisely as possible). */
10854         d = dnint(d1);
10855         f1 = d1 - d;
10856         djd = d;
10857         d = dnint(d2);
10858         f2 = d2 - d;
10859         djd += d;
10860         d = dnint(f1 + f2);
10861         f = (f1 - d) + f2;
10862         if (f < 0.0) {
10863             f += 1.0;
10864             d -= 1.0;
10865         }
10866         djd += d;
10867 
10868         /* Round the total fraction to the specified number of places. */
10869         rf = dnint(f*denom) / denom;
10870 
10871         /* Re-align to noon. */
10872         djd += 0.5;
10873 
10874         /* Convert to Gregorian Calendar. */
10875         try {
10876             Calendar cal = jauJd2cal(djd, rf);
10877             iymdf[0] = cal.iy;
10878             iymdf[1] = cal.im;
10879             iymdf[2] = cal.id;
10880             iymdf[3] = (int) dnint(cal.fd * denom);
10881         } catch (JSOFAIllegalParameter e) {
10882             j = -1;
10883         }
10884 
10885         /* Return the status. */
10886         return j;
10887 
10888     }
10889     
10890 
10891     /**
10892     *  Form the matrix of nutation for a given date, IAU 2000A model.
10893     *
10894     *<p>This function is derived from the International Astronomical Union's
10895     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10896     *
10897     *<p>Status:  support function.
10898     *
10899     *<!-- Given: -->
10900     *     @param date1 double TT as a 2-part Julian Date (Note 1)
10901     *     @param date2 double TT as a 2-part Julian Date (Note 1)
10902     *
10903     *<!-- Returned: -->
10904     *     @return rmatn         double[3][3]      <u>returned</u> nutation matrix
10905     *
10906     * <p>Notes:
10907     * <ol>
10908     *
10909     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
10910     *     convenient way between the two arguments.  For example,
10911     *     JD(TT)=2450123.7 could be expressed in any of these ways,
10912     *     among others:
10913     *<pre>
10914     *            date1          date2
10915     *
10916     *         2450123.7           0.0       (JD method)
10917     *         2451545.0       -1421.3       (J2000 method)
10918     *         2400000.5       50123.2       (MJD method)
10919     *         2450123.5           0.2       (date &amp; time method)
10920     *</pre>
10921     *     The JD method is the most natural and convenient to use in
10922     *     cases where the loss of several decimal digits of resolution
10923     *     is acceptable.  The J2000 method is best matched to the way
10924     *     the argument is handled internally and will deliver the
10925     *     optimum resolution.  The MJD method and the date &amp; time methods
10926     *     are both good compromises between resolution and convenience.
10927     *
10928     * <li> The matrix operates in the sense V(true) = rmatn * V(mean), where
10929     *     the p-vector V(true) is with respect to the true equatorial triad
10930     *     of date and the p-vector V(mean) is with respect to the mean
10931     *     equatorial triad of date.
10932     *
10933     * <li> A faster, but slightly less accurate, result (about 1 mas), can be
10934     *     obtained by using instead the jauNum00b function.
10935     *</ol>
10936     *<p>Called:<ul>
10937     *     <li>{@link #jauPn00a} bias/precession/nutation, IAU 2000A
10938     * </ul>
10939     *<p>Reference:
10940     *
10941     *     <p>Explanatory Supplement to the Astronomical Almanac,
10942     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10943     *     Section 3.222-3 (p114).
10944     *
10945     *@version 2008 May 12
10946     *
10947     *  @since Release 20101201
10948     *
10949     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10950     */
10951     public static double[][] jauNum00a(double date1, double date2)
10952     {
10953 
10954     /* Obtain the required matrix (discarding other results). */
10955        PrecessionNutation pn = jauPn00a(date1, date2);
10956 
10957        return pn.rn ;
10958 
10959         }
10960     
10961 
10962     /**
10963     *  Form the matrix of nutation for a given date, IAU 2000B model.
10964     *
10965     *<p>This function is derived from the International Astronomical Union's
10966     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10967     *
10968     *<p>Status:  support function.
10969     *
10970     *<!-- Given: -->
10971     *     @param date1 double TT as a 2-part Julian Date (Note 1)
10972     *     @param date2 double TT as a 2-part Julian Date (Note 1)
10973     *
10974     *<!-- Returned: -->
10975     *     @return rmatn         double[3][3]     <u>returned</u> nutation matrix
10976     *
10977     * <p>Notes:
10978     * <ol>
10979     *
10980     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
10981     *     convenient way between the two arguments.  For example,
10982     *     JD(TT)=2450123.7 could be expressed in any of these ways,
10983     *     among others:
10984     *<pre>
10985     *            date1          date2
10986     *
10987     *         2450123.7           0.0       (JD method)
10988     *         2451545.0       -1421.3       (J2000 method)
10989     *         2400000.5       50123.2       (MJD method)
10990     *         2450123.5           0.2       (date &amp; time method)
10991     *</pre>
10992     *     The JD method is the most natural and convenient to use in
10993     *     cases where the loss of several decimal digits of resolution
10994     *     is acceptable.  The J2000 method is best matched to the way
10995     *     the argument is handled internally and will deliver the
10996     *     optimum resolution.  The MJD method and the date &amp; time methods
10997     *     are both good compromises between resolution and convenience.
10998     *
10999     * <li> The matrix operates in the sense V(true) = rmatn * V(mean), where
11000     *     the p-vector V(true) is with respect to the true equatorial triad
11001     *     of date and the p-vector V(mean) is with respect to the mean
11002     *     equatorial triad of date.
11003     *
11004     * <li> The present function is faster, but slightly less accurate (about
11005     *     1 mas), than the jauNum00a function.
11006     *</ol>
11007     *<p>Called:<ul>
11008     *     <li>{@link #jauPn00b} bias/precession/nutation, IAU 2000B
11009     * </ul>
11010     *<p>Reference:
11011     *
11012     *     <p>Explanatory Supplement to the Astronomical Almanac,
11013     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
11014     *     Section 3.222-3 (p114).
11015     *
11016     *@version 2008 May 12
11017     *
11018     *  @since Release 20101201
11019     *
11020     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
11021     */
11022     public static double[][] jauNum00b(double date1, double date2)
11023     {
11024 
11025     /* Obtain the required matrix (discarding other results). */
11026        PrecessionNutation pn = jauPn00b(date1, date2);
11027  
11028        return pn.rn;
11029 
11030     }
11031     
11032 
11033     /**
11034     *  Form the matrix of nutation for a given date, IAU 2006/2000A model.
11035     *
11036     *<p>This function is derived from the International Astronomical Union's
11037     *  SOFA (Standards Of Fundamental Astronomy) software collection.
11038     *
11039     *<p>Status:  support function.
11040     *
11041     *<!-- Given: -->
11042     *     @param date1 double TT as a 2-part Julian Date (Note 1)
11043     *     @param date2 double TT as a 2-part Julian Date (Note 1)
11044     *
11045     *<!-- Returned: -->
11046     *     @return rmatn          double[3][3]      <u>returned</u> nutation matrix
11047     *
11048     * <p>Notes:
11049     * <ol>
11050     *
11051     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
11052     *     convenient way between the two arguments.  For example,
11053     *     JD(TT)=2450123.7 could be expressed in any of these ways,
11054     *     among others:
11055     *<pre>
11056     *            date1          date2
11057     *
11058     *         2450123.7           0.0       (JD method)
11059     *         2451545.0       -1421.3       (J2000 method)
11060     *         2400000.5       50123.2       (MJD method)
11061     *         2450123.5           0.2       (date &amp; time method)
11062     *</pre>
11063     *     The JD method is the most natural and convenient to use in
11064     *     cases where the loss of several decimal digits of resolution
11065     *     is acceptable.  The J2000 method is best matched to the way
11066     *     the argument is handled internally and will deliver the
11067     *     optimum resolution.  The MJD method and the date &amp; time methods
11068     *     are both good compromises between resolution and convenience.
11069     *
11070     * <li> The matrix operates in the sense V(true) = rmatn * V(mean), where
11071     *     the p-vector V(true) is with respect to the true equatorial triad
11072     *     of date and the p-vector V(mean) is with respect to the mean
11073     *     equatorial triad of date.
11074     *</ol>
11075     *<p>Called:<ul>
11076     *     <li>{@link #jauObl06} mean obliquity, IAU 2006
11077     *     <li>{@link #jauNut06a} nutation, IAU 2006/2000A
11078     *     <li>{@link #jauNumat} form nutation matrix
11079     * </ul>
11080     *<p>Reference:
11081     *
11082     *     <p>Explanatory Supplement to the Astronomical Almanac,
11083     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
11084     *     Section 3.222-3 (p114).
11085     *
11086     *@version 2008 May 12
11087     *
11088     *  @since Release 20101201
11089     *
11090     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
11091     */
11092     public static double[][] jauNum06a(double date1, double date2)
11093     {
11094        double eps, rmatn[][];
11095 
11096 
11097     /* Mean obliquity. */
11098        eps = jauObl06(date1, date2);
11099 
11100     /* Nutation components. */
11101        NutationTerms nut = jauNut06a(date1, date2);
11102 
11103     /* Nutation matrix. */
11104        rmatn = jauNumat(eps, nut.dpsi, nut.deps);
11105 
11106        return rmatn;
11107 
11108         }
11109     
11110 
11111     /**
11112     *  Form the matrix of nutation.
11113     *
11114     *<p>This function is derived from the International Astronomical Union's
11115     *  SOFA (Standards Of Fundamental Astronomy) software collection.
11116     *
11117     *<p>Status:  support function.
11118     *
11119     *<!-- Given: -->
11120     *     @param epsa         double          mean obliquity of date (Note 1)
11121     *     @param dpsi double          nutation (Note 2)
11122     *     @param deps double          nutation (Note 2) 
11123     *
11124     *<!-- Returned: -->
11125     *     @return rmatn        double[3][3]     <u>returned</u> nutation matrix (Note 3)
11126     *
11127     * <p>Notes:
11128     * <ol>
11129     *
11130     *
11131     * <li> The supplied mean obliquity epsa, must be consistent with the
11132     *     precession-nutation models from which dpsi and deps were obtained.
11133     *
11134     * <li> The caller is responsible for providing the nutation components;
11135     *     they are in longitude and obliquity, in radians and are with
11136     *     respect to the equinox and ecliptic of date.
11137     *
11138     * <li> The matrix operates in the sense V(true) = rmatn * V(mean),
11139     *     where the p-vector V(true) is with respect to the true
11140     *     equatorial triad of date and the p-vector V(mean) is with
11141     *     respect to the mean equatorial triad of date.
11142     *</ol>
11143     *<p>Called:<ul>
11144     *     <li>{@link #jauIr} initialize r-matrix to identity
11145     *     <li>{@link #jauRx} rotate around X-axis
11146     *     <li>{@link #jauRz} rotate around Z-axis
11147     * </ul>
11148     *<p>Reference:
11149     *
11150     *     <p>Explanatory Supplement to the Astronomical Almanac,
11151     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
11152     *     Section 3.222-3 (p114).
11153     *
11154     *@version 2008 May 11
11155     *
11156     *  @since Release 20101201
11157     *
11158     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
11159     */
11160     public static double[][] jauNumat(double epsa, double dpsi, double deps)
11161     {
11162         double rmatn[][] = new double[3][3];
11163     /* Build the rotation matrix. */
11164        jauIr(rmatn);
11165        jauRx(epsa, rmatn);
11166        jauRz(-dpsi, rmatn);
11167        jauRx(-(epsa + deps), rmatn);
11168 
11169        return rmatn;
11170 
11171         }
11172     /**
11173      * Nutation Terms.
11174      *  .
11175      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 21 Nov 2011
11176      * @version $Revision$ $date$
11177      */
11178     public static class NutationTerms {
11179         /**  nutation component in longitude  */
11180         public double dpsi;
11181         /**  nutation component in obliquity */
11182         public double deps;
11183         public NutationTerms(double dpsi, double deps) {
11184             this.dpsi = dpsi;
11185             this.deps = deps;
11186         }
11187     }
11188     private static final class NutationModel {
11189           int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */
11190           double sp,spt,cp;     /* longitude sin, t*sin, cos coefficients */
11191           double ce,cet,se;     /* obliquity cos, t*cos, sin coefficients */
11192           public NutationModel(int nl,int nlp,int nf,int nd, int nom,
11193           double sp,double spt,double cp,     
11194           double ce,double cet,double se ) {
11195            this.nl = nl;
11196            this.nlp = nlp;
11197            this.nf = nf;
11198            this.nd = nd;
11199            this.nom = nom;
11200            this.sp = sp;
11201            this.spt = spt;
11202            this.cp = cp;
11203            this.ce = ce;
11204            this.cet = cet;
11205            this.se = se;
11206         }
11207        }
11208         private final static class PlanetaryNutModel {
11209          final int nl,               /* coefficients of l, F, D and Omega */
11210               nf,
11211               nd,
11212               nom,
11213               nme,              /* coefficients of planetary longitudes */
11214               nve,
11215               nea,
11216               nma,
11217               nju,
11218               nsa,
11219               nur,
11220               nne,
11221               npa;              /* coefficient of general precession */
11222           final int sp,cp;            /* longitude sin, cos coefficients */
11223           final int se,ce;            /* obliquity sin, cos coefficients */
11224           public PlanetaryNutModel(          int nl,               
11225                   int nf,
11226                   int nd,
11227                   int nom,
11228                   int nme,     
11229                   int nve,
11230                   int nea,
11231                   int nma,
11232                   int nju,
11233                   int nsa,
11234                   int nur,
11235                   int nne,
11236                   int npa,              
11237               int sp,int cp,           
11238               int se,int ce           
11239 ) {
11240               this.nl = nl;               /* coefficients of l, F, D and Omega */
11241               this.nf = nf;
11242               this.nd = nd;
11243               this.nom = nom;
11244               this.nme = nme;              /* coefficients of planetary longitudes */
11245               this.nve = nve;
11246               this.nea = nea;
11247               this.nma = nma;
11248               this.nju = nju;
11249               this.nsa = nsa;
11250               this.nur = nur;
11251               this.nne = nne;
11252               this.npa = npa;              /* coefficient of general precession */
11253            this.sp = sp; this.cp = cp;            /* longitude sin, cos coefficients */
11254            this.se = se; this.ce = ce;            /* obliquity sin, cos coefficients */
11255       
11256         }
11257        }
11258     /**
11259     *  Nutation, IAU 2000A model (MHB2000 luni-solar and planetary nutation
11260     *  with free core nutation omitted).
11261     *
11262     *<p>This function is derived from the International Astronomical Union's
11263     *  SOFA (Standards Of Fundamental Astronomy) software collection.
11264     *
11265     *<p>Status:  canonical model.
11266     *
11267     *<!-- Given: -->
11268     *     @param date1 double TT as a 2-part Julian Date (Note 1)
11269     *     @param date2 double TT as a 2-part Julian Date (Note 1)
11270     *
11271     *<!-- Returned: -->
11272     *     @return    <u>returned</u> nutation, luni-solar + planetary (Note 2)
11273     *
11274     * <p>Notes:
11275     * <ol>
11276     *
11277     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
11278     *     convenient way between the two arguments.  For example,
11279     *     JD(TT)=2450123.7 could be expressed in any of these ways,
11280     *     among others:
11281     *<pre>
11282     *            date1          date2
11283     *
11284     *         2450123.7           0.0       (JD method)
11285     *         2451545.0       -1421.3       (J2000 method)
11286     *         2400000.5       50123.2       (MJD method)
11287     *         2450123.5           0.2       (date &amp; time method)
11288     *</pre>
11289     *     The JD method is the most natural and convenient to use in
11290     *     cases where the loss of several decimal digits of resolution
11291     *     is acceptable.  The J2000 method is best matched to the way
11292     *     the argument is handled internally and will deliver the
11293     *     optimum resolution.  The MJD method and the date &amp; time methods
11294     *     are both good compromises between resolution and convenience.
11295     *
11296     * <li> The nutation components in longitude and obliquity are in radians
11297     *     and with respect to the equinox and ecliptic of date.  The
11298     *     obliquity at J2000.0 is assumed to be the Lieske et al. (1977)
11299     *     value of 84381.448 arcsec.
11300     *
11301     *     Both the luni-solar and planetary nutations are included.  The
11302     *     latter are due to direct planetary nutations and the
11303     *     perturbations of the lunar and terrestrial orbits.
11304     *
11305     * <li> The function computes the MHB2000 nutation series with the
11306     *     associated corrections for planetary nutations.  It is an
11307     *     implementation of the nutation part of the IAU 2000A precession-
11308     *     nutation model, formally adopted by the IAU General Assembly in
11309     *     2000, namely MHB2000 (Mathews et al. 2002), but with the free
11310     *     core nutation (FCN - see Note 4) omitted.
11311     *
11312     * <li> The full MHB2000 model also contains contributions to the
11313     *     nutations in longitude and obliquity due to the free-excitation
11314     *     of the free-core-nutation during the period 1979-2000.  These FCN
11315     *     terms, which are time-dependent and unpredictable, are NOT
11316     *     included in the present function and, if required, must be
11317     *     independently computed.  With the FCN corrections included, the
11318     *     present function delivers a pole which is at current epochs
11319     *     accurate to a few hundred microarcseconds.  The omission of FCN
11320     *     introduces further errors of about that size.
11321     *
11322     * <li> The present function provides classical nutation.  The MHB2000
11323     *     algorithm, from which it is adapted, deals also with (i) the
11324     *     offsets between the GCRS and mean poles and (ii) the adjustments
11325     *     in longitude and obliquity due to the changed precession rates.
11326     *     These additional functions, namely frame bias and precession
11327     *     adjustments, are supported by the JSOFA functions jauBi00  and
11328     *     jauPr00.
11329     *
11330     * <li> The MHB2000 algorithm also provides "total" nutations, comprising
11331     *     the arithmetic sum of the frame bias, precession adjustments,
11332     *     luni-solar nutation and planetary nutation.  These total
11333     *     nutations can be used in combination with an existing IAU 1976
11334     *     precession implementation, such as jauPmat76,  to deliver GCRS-
11335     *     to-true predictions of sub-mas accuracy at current dates.
11336     *     However, there are three shortcomings in the MHB2000 model that
11337     *     must be taken into account if more accurate or definitive results
11338     *     are required (see Wallace 2002):
11339     *
11340     *       (i) The MHB2000 total nutations are simply arithmetic sums,
11341     *           yet in reality the various components are successive Euler
11342     *           rotations.  This slight lack of rigor leads to cross terms
11343     *           that exceed 1 mas after a century.  The rigorous procedure
11344     *           is to form the GCRS-to-true rotation matrix by applying the
11345     *           bias, precession and nutation in that order.
11346     *
11347     *      (ii) Although the precession adjustments are stated to be with
11348     *           respect to Lieske et al. (1977), the MHB2000 model does
11349     *           not specify which set of Euler angles are to be used and
11350     *           how the adjustments are to be applied.  The most literal
11351     *           and straightforward procedure is to adopt the 4-rotation
11352     *           epsilon_0, psi_A, omega_A, xi_A option, and to add DPSIPR
11353     *           to psi_A and DEPSPR to both omega_A and eps_A.
11354     *
11355     *     (iii) The MHB2000 model predates the determination by Chapront
11356     *           et al. (2002) of a 14.6 mas displacement between the
11357     *           J2000.0 mean equinox and the origin of the ICRS frame.  It
11358     *           should, however, be noted that neglecting this displacement
11359     *           when calculating star coordinates does not lead to a
11360     *           14.6 mas change in right ascension, only a small second-
11361     *           order distortion in the pattern of the precession-nutation
11362     *           effect.
11363     *
11364     *     For these reasons, the JSOFA functions do not generate the "total
11365     *     nutations" directly, though they can of course easily be
11366     *     generated by calling jauBi00, jauPr00 and the present function
11367     *     and adding the results.
11368     *
11369     * <li> The MHB2000 model contains 41 instances where the same frequency
11370     *     appears multiple times, of which 38 are duplicates and three are
11371     *     triplicates.  To keep the present code close to the original MHB
11372     *     algorithm, this small inefficiency has not been corrected.
11373     *</ol>
11374     *<p>Called:<ul>
11375     *     <li>{@link #jauFal03} mean anomaly of the Moon
11376     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
11377     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
11378     *     <li>{@link #jauFame03} mean longitude of Mercury
11379     *     <li>{@link #jauFave03} mean longitude of Venus
11380     *     <li>{@link #jauFae03} mean longitude of Earth
11381     *     <li>{@link #jauFama03} mean longitude of Mars
11382     *     <li>{@link #jauFaju03} mean longitude of Jupiter
11383     *     <li>{@link #jauFasa03} mean longitude of Saturn
11384     *     <li>{@link #jauFaur03} mean longitude of Uranus
11385     *     <li>{@link #jauFapa03} general accumulated precession in longitude
11386     * </ul>
11387     *<p>References:
11388     *
11389     *     <p>Chapront, J., Chapront-Touze, M. &amp; Francou, G. 2002,
11390     *     Astron.Astrophys. 387, 700
11391     *
11392     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B. 1977,
11393     *     Astron.Astrophys. 58, 1-16
11394     *
11395     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A. 2002, J.Geophys.Res.
11396     *     107, B4.  The MHB_2000 code itself was obtained on 9th September
11397     *     2002 from ftp//maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
11398     *
11399     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
11400     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
11401     *
11402     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
11403     *     Astron.Astrophys.Supp.Ser. 135, 111
11404     *
11405     *    <p>Wallace, P.T., "Software for Implementing the IAU 2000
11406     *     Resolutions", in IERS Workshop 5.1 (2002)
11407     *
11408     *@version 2009 December 17
11409     *
11410     *  @since Release 20101201
11411     *
11412     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
11413     */
11414     public static NutationTerms jauNut00a(double date1, double date2 )
11415     {
11416        int i;
11417        double t, el, elp, f, d, om, arg, dp, de, sarg, carg,
11418               al, af, ad, aom, alme, alve, alea, alma,
11419               alju, alsa, alur, alne, apa, dpsils, depsls,
11420               dpsipl, depspl;
11421 
11422     /* Units of 0.1 microarcsecond to radians */
11423        final double U2R = DAS2R / 1e7;
11424 
11425     /* ------------------------- */
11426     /* Luni-Solar nutation model */
11427     /* ------------------------- */
11428 
11429     /* The units for the sine and cosine coefficients are */
11430     /* 0.1 microarcsecond and the same per Julian century */
11431 
11432        
11433        NutationModel xls[] = {
11434 
11435        /* 1- 10 */
11436           new NutationModel( 0, 0, 0, 0, 1,
11437              -172064161.0, -174666.0, 33386.0, 92052331.0, 9086.0, 15377.0),
11438           new NutationModel( 0, 0, 2,-2, 2,
11439                -13170906.0, -1675.0, -13696.0, 5730336.0, -3015.0, -4587.0),
11440           new NutationModel( 0, 0, 2, 0, 2,-2276413.0,-234.0,2796.0,978459.0,-485.0, 1374.0),
11441           new NutationModel( 0, 0, 0, 0, 2,2074554.0, 207.0, -698.0,-897492.0,470.0, -291.0),
11442           new NutationModel( 0, 1, 0, 0, 0,1475877.0,-3633.0,11817.0,73871.0,-184.0,-1924.0),
11443           new NutationModel( 0, 1, 2,-2, 2,-516821.0,1226.0, -524.0,224386.0,-677.0, -174.0),
11444           new NutationModel( 1, 0, 0, 0, 0, 711159.0,  73.0, -872.0,  -6750.0,  0.0,  358.0),
11445           new NutationModel( 0, 0, 2, 0, 1,-387298.0,-367.0,  380.0, 200728.0, 18.0,  318.0),
11446           new NutationModel( 1, 0, 2, 0, 2,-301461.0, -36.0,  816.0, 129025.0,-63.0,  367.0),
11447           new NutationModel( 0,-1, 2,-2, 2, 215829.0,-494.0,  111.0, -95929.0,299.0,  132.0),
11448 
11449        /* 11-20 */
11450           new NutationModel( 0, 0, 2,-2, 1, 128227.0, 137.0,  181.0, -68982.0, -9.0,   39.0),
11451           new NutationModel(-1, 0, 2, 0, 2, 123457.0,  11.0,   19.0, -53311.0, 32.0,   -4.0),
11452           new NutationModel(-1, 0, 0, 2, 0, 156994.0,  10.0, -168.0,  -1235.0,  0.0,   82.0),
11453           new NutationModel( 1, 0, 0, 0, 1,  63110.0,  63.0,   27.0, -33228.0,  0.0,   -9.0),
11454           new NutationModel(-1, 0, 0, 0, 1, -57976.0, -63.0, -189.0,  31429.0,  0.0,  -75.0),
11455           new NutationModel(-1, 0, 2, 2, 2, -59641.0, -11.0,  149.0,  25543.0,-11.0,   66.0),
11456           new NutationModel( 1, 0, 2, 0, 1, -51613.0, -42.0,  129.0,  26366.0,  0.0,   78.0),
11457           new NutationModel(-2, 0, 2, 0, 1,  45893.0,  50.0,   31.0, -24236.0,-10.0,   20.0),
11458           new NutationModel( 0, 0, 0, 2, 0,  63384.0,  11.0, -150.0,  -1220.0,  0.0,   29.0),
11459           new NutationModel( 0, 0, 2, 2, 2, -38571.0,  -1.0,  158.0,  16452.0,-11.0,   68.0),
11460 
11461        /* 21-30 */
11462           new NutationModel( 0,-2, 2,-2, 2,  32481.0,   0.0,    0.0, -13870.0,  0.0,    0.0),
11463           new NutationModel(-2, 0, 0, 2, 0, -47722.0,   0.0,  -18.0,    477.0,  0.0,  -25.0),
11464           new NutationModel( 2, 0, 2, 0, 2, -31046.0,  -1.0,  131.0,  13238.0,-11.0,   59.0),
11465           new NutationModel( 1, 0, 2,-2, 2,  28593.0,   0.0,   -1.0, -12338.0, 10.0,   -3.0),
11466           new NutationModel(-1, 0, 2, 0, 1,  20441.0,  21.0,   10.0, -10758.0,  0.0,   -3.0),
11467           new NutationModel( 2, 0, 0, 0, 0,  29243.0,   0.0,  -74.0,   -609.0,  0.0,   13.0),
11468           new NutationModel( 0, 0, 2, 0, 0,  25887.0,   0.0,  -66.0,   -550.0,  0.0,   11.0),
11469           new NutationModel( 0, 1, 0, 0, 1, -14053.0, -25.0,   79.0,   8551.0, -2.0,  -45.0),
11470           new NutationModel(-1, 0, 0, 2, 1,  15164.0,  10.0,   11.0,  -8001.0,  0.0,   -1.0),
11471           new NutationModel( 0, 2, 2,-2, 2, -15794.0,  72.0,  -16.0,   6850.0,-42.0,   -5.0),
11472 
11473        /* 31-40 */
11474           new NutationModel( 0, 0,-2, 2, 0,  21783.0,   0.0,   13.0,   -167.0,  0.0,   13.0),
11475           new NutationModel( 1, 0, 0,-2, 1, -12873.0, -10.0,  -37.0,   6953.0,  0.0,  -14.0),
11476           new NutationModel( 0,-1, 0, 0, 1, -12654.0,  11.0,   63.0,   6415.0,  0.0,   26.0),
11477           new NutationModel(-1, 0, 2, 2, 1, -10204.0,   0.0,   25.0,   5222.0,  0.0,   15.0),
11478           new NutationModel( 0, 2, 0, 0, 0,  16707.0, -85.0,  -10.0,    168.0, -1.0,   10.0),
11479           new NutationModel( 1, 0, 2, 2, 2,  -7691.0,   0.0,   44.0,   3268.0,  0.0,   19.0),
11480           new NutationModel(-2, 0, 2, 0, 0, -11024.0,   0.0,  -14.0,    104.0,  0.0,    2.0),
11481           new NutationModel( 0, 1, 2, 0, 2,   7566.0, -21.0,  -11.0,  -3250.0,  0.0,   -5.0),
11482           new NutationModel( 0, 0, 2, 2, 1,  -6637.0, -11.0,   25.0,   3353.0,  0.0,   14.0),
11483           new NutationModel( 0,-1, 2, 0, 2,  -7141.0,  21.0,    8.0,   3070.0,  0.0,    4.0),
11484 
11485        /* 41-50 */
11486           new NutationModel( 0, 0, 0, 2, 1,  -6302.0, -11.0,    2.0,   3272.0,  0.0,    4.0),
11487           new NutationModel( 1, 0, 2,-2, 1,   5800.0,  10.0,    2.0,  -3045.0,  0.0,   -1.0),
11488           new NutationModel( 2, 0, 2,-2, 2,   6443.0,   0.0,   -7.0,  -2768.0,  0.0,   -4.0),
11489           new NutationModel(-2, 0, 0, 2, 1,  -5774.0, -11.0,  -15.0,   3041.0,  0.0,   -5.0),
11490           new NutationModel( 2, 0, 2, 0, 1,  -5350.0,   0.0,   21.0,   2695.0,  0.0,   12.0),
11491           new NutationModel( 0,-1, 2,-2, 1,  -4752.0, -11.0,   -3.0,   2719.0,  0.0,   -3.0),
11492           new NutationModel( 0, 0, 0,-2, 1,  -4940.0, -11.0,  -21.0,   2720.0,  0.0,   -9.0),
11493           new NutationModel(-1,-1, 0, 2, 0,   7350.0,   0.0,   -8.0,    -51.0,  0.0,    4.0),
11494           new NutationModel( 2, 0, 0,-2, 1,   4065.0,   0.0,    6.0,  -2206.0,  0.0,    1.0),
11495           new NutationModel( 1, 0, 0, 2, 0,   6579.0,   0.0,  -24.0,   -199.0,  0.0,    2.0),
11496 
11497        /* 51-60 */
11498           new NutationModel( 0, 1, 2,-2, 1,   3579.0,   0.0,    5.0,  -1900.0,  0.0,    1.0),
11499           new NutationModel( 1,-1, 0, 0, 0,   4725.0,   0.0,   -6.0,    -41.0,  0.0,    3.0),
11500           new NutationModel(-2, 0, 2, 0, 2,  -3075.0,   0.0,   -2.0,   1313.0,  0.0,   -1.0),
11501           new NutationModel( 3, 0, 2, 0, 2,  -2904.0,   0.0,   15.0,   1233.0,  0.0,    7.0),
11502           new NutationModel( 0,-1, 0, 2, 0,   4348.0,   0.0,  -10.0,    -81.0,  0.0,    2.0),
11503           new NutationModel( 1,-1, 2, 0, 2,  -2878.0,   0.0,    8.0,   1232.0,  0.0,    4.0),
11504           new NutationModel( 0, 0, 0, 1, 0,  -4230.0,   0.0,    5.0,    -20.0,  0.0,   -2.0),
11505           new NutationModel(-1,-1, 2, 2, 2,  -2819.0,   0.0,    7.0,   1207.0,  0.0,    3.0),
11506           new NutationModel(-1, 0, 2, 0, 0,  -4056.0,   0.0,    5.0,     40.0,  0.0,   -2.0),
11507           new NutationModel( 0,-1, 2, 2, 2,  -2647.0,   0.0,   11.0,   1129.0,  0.0,    5.0),
11508 
11509        /* 61-70 */
11510           new NutationModel(-2, 0, 0, 0, 1,  -2294.0,   0.0,  -10.0,   1266.0,  0.0,   -4.0),
11511           new NutationModel( 1, 1, 2, 0, 2,   2481.0,   0.0,   -7.0,  -1062.0,  0.0,   -3.0),
11512           new NutationModel( 2, 0, 0, 0, 1,   2179.0,   0.0,   -2.0,  -1129.0,  0.0,   -2.0),
11513           new NutationModel(-1, 1, 0, 1, 0,   3276.0,   0.0,    1.0,     -9.0,  0.0,    0.0),
11514           new NutationModel( 1, 1, 0, 0, 0,  -3389.0,   0.0,    5.0,     35.0,  0.0,   -2.0),
11515           new NutationModel( 1, 0, 2, 0, 0,   3339.0,   0.0,  -13.0,   -107.0,  0.0,    1.0),
11516           new NutationModel(-1, 0, 2,-2, 1,  -1987.0,   0.0,   -6.0,   1073.0,  0.0,   -2.0),
11517           new NutationModel( 1, 0, 0, 0, 2,  -1981.0,   0.0,    0.0,    854.0,  0.0,    0.0),
11518           new NutationModel(-1, 0, 0, 1, 0,   4026.0,   0.0, -353.0,   -553.0,  0.0, -139.0),
11519           new NutationModel( 0, 0, 2, 1, 2,   1660.0,   0.0,   -5.0,   -710.0,  0.0,   -2.0),
11520 
11521        /* 71-80 */
11522           new NutationModel(-1, 0, 2, 4, 2,  -1521.0,   0.0,    9.0,    647.0,  0.0,    4.0),
11523           new NutationModel(-1, 1, 0, 1, 1,   1314.0,   0.0,    0.0,   -700.0,  0.0,    0.0),
11524           new NutationModel( 0,-2, 2,-2, 1,  -1283.0,   0.0,    0.0,    672.0,  0.0,    0.0),
11525           new NutationModel( 1, 0, 2, 2, 1,  -1331.0,   0.0,    8.0,    663.0,  0.0,    4.0),
11526           new NutationModel(-2, 0, 2, 2, 2,   1383.0,   0.0,   -2.0,   -594.0,  0.0,   -2.0),
11527           new NutationModel(-1, 0, 0, 0, 2,   1405.0,   0.0,    4.0,   -610.0,  0.0,    2.0),
11528           new NutationModel( 1, 1, 2,-2, 2,   1290.0,   0.0,    0.0,   -556.0,  0.0,    0.0),
11529           new NutationModel(-2, 0, 2, 4, 2,  -1214.0,   0.0,    5.0,    518.0,  0.0,    2.0),
11530           new NutationModel(-1, 0, 4, 0, 2,   1146.0,   0.0,   -3.0,   -490.0,  0.0,   -1.0),
11531           new NutationModel( 2, 0, 2,-2, 1,   1019.0,   0.0,   -1.0,   -527.0,  0.0,   -1.0),
11532 
11533        /* 81-90 */
11534           new NutationModel( 2, 0, 2, 2, 2,  -1100.0,   0.0,    9.0,    465.0,  0.0,    4.0),
11535           new NutationModel( 1, 0, 0, 2, 1,   -970.0,   0.0,    2.0,    496.0,  0.0,    1.0),
11536           new NutationModel( 3, 0, 0, 0, 0,   1575.0,   0.0,   -6.0,    -50.0,  0.0,    0.0),
11537           new NutationModel( 3, 0, 2,-2, 2,    934.0,   0.0,   -3.0,   -399.0,  0.0,   -1.0),
11538           new NutationModel( 0, 0, 4,-2, 2,    922.0,   0.0,   -1.0,   -395.0,  0.0,   -1.0),
11539           new NutationModel( 0, 1, 2, 0, 1,    815.0,   0.0,   -1.0,   -422.0,  0.0,   -1.0),
11540           new NutationModel( 0, 0,-2, 2, 1,    834.0,   0.0,    2.0,   -440.0,  0.0,    1.0),
11541           new NutationModel( 0, 0, 2,-2, 3,   1248.0,   0.0,    0.0,   -170.0,  0.0,    1.0),
11542           new NutationModel(-1, 0, 0, 4, 0,   1338.0,   0.0,   -5.0,    -39.0,  0.0,    0.0),
11543           new NutationModel( 2, 0,-2, 0, 1,    716.0,   0.0,   -2.0,   -389.0,  0.0,   -1.0),
11544 
11545        /* 91-100 */
11546           new NutationModel(-2, 0, 0, 4, 0,   1282.0,   0.0,   -3.0,    -23.0,  0.0,    1.0),
11547           new NutationModel(-1,-1, 0, 2, 1,    742.0,   0.0,    1.0,   -391.0,  0.0,    0.0),
11548           new NutationModel(-1, 0, 0, 1, 1,   1020.0,   0.0,  -25.0,   -495.0,  0.0,  -10.0),
11549           new NutationModel( 0, 1, 0, 0, 2,    715.0,   0.0,   -4.0,   -326.0,  0.0,    2.0),
11550           new NutationModel( 0, 0,-2, 0, 1,   -666.0,   0.0,   -3.0,    369.0,  0.0,   -1.0),
11551           new NutationModel( 0,-1, 2, 0, 1,   -667.0,   0.0,    1.0,    346.0,  0.0,    1.0),
11552           new NutationModel( 0, 0, 2,-1, 2,   -704.0,   0.0,    0.0,    304.0,  0.0,    0.0),
11553           new NutationModel( 0, 0, 2, 4, 2,   -694.0,   0.0,    5.0,    294.0,  0.0,    2.0),
11554           new NutationModel(-2,-1, 0, 2, 0,  -1014.0,   0.0,   -1.0,      4.0,  0.0,   -1.0),
11555           new NutationModel( 1, 1, 0,-2, 1,   -585.0,   0.0,   -2.0,    316.0,  0.0,   -1.0),
11556 
11557        /* 101-110 */
11558           new NutationModel(-1, 1, 0, 2, 0,   -949.0,   0.0,    1.0,      8.0,  0.0,   -1.0),
11559           new NutationModel(-1, 1, 0, 1, 2,   -595.0,   0.0,    0.0,    258.0,  0.0,    0.0),
11560           new NutationModel( 1,-1, 0, 0, 1,    528.0,   0.0,    0.0,   -279.0,  0.0,    0.0),
11561           new NutationModel( 1,-1, 2, 2, 2,   -590.0,   0.0,    4.0,    252.0,  0.0,    2.0),
11562           new NutationModel(-1, 1, 2, 2, 2,    570.0,   0.0,   -2.0,   -244.0,  0.0,   -1.0),
11563           new NutationModel( 3, 0, 2, 0, 1,   -502.0,   0.0,    3.0,    250.0,  0.0,    2.0),
11564           new NutationModel( 0, 1,-2, 2, 0,   -875.0,   0.0,    1.0,     29.0,  0.0,    0.0),
11565           new NutationModel(-1, 0, 0,-2, 1,   -492.0,   0.0,   -3.0,    275.0,  0.0,   -1.0),
11566           new NutationModel( 0, 1, 2, 2, 2,    535.0,   0.0,   -2.0,   -228.0,  0.0,   -1.0),
11567           new NutationModel(-1,-1, 2, 2, 1,   -467.0,   0.0,    1.0,    240.0,  0.0,    1.0),
11568 
11569        /* 111-120 */
11570           new NutationModel( 0,-1, 0, 0, 2,    591.0,   0.0,    0.0,   -253.0,  0.0,    0.0),
11571           new NutationModel( 1, 0, 2,-4, 1,   -453.0,   0.0,   -1.0,    244.0,  0.0,   -1.0),
11572           new NutationModel(-1, 0,-2, 2, 0,    766.0,   0.0,    1.0,      9.0,  0.0,    0.0),
11573           new NutationModel( 0,-1, 2, 2, 1,   -446.0,   0.0,    2.0,    225.0,  0.0,    1.0),
11574           new NutationModel( 2,-1, 2, 0, 2,   -488.0,   0.0,    2.0,    207.0,  0.0,    1.0),
11575           new NutationModel( 0, 0, 0, 2, 2,   -468.0,   0.0,    0.0,    201.0,  0.0,    0.0),
11576           new NutationModel( 1,-1, 2, 0, 1,   -421.0,   0.0,    1.0,    216.0,  0.0,    1.0),
11577           new NutationModel(-1, 1, 2, 0, 2,    463.0,   0.0,    0.0,   -200.0,  0.0,    0.0),
11578           new NutationModel( 0, 1, 0, 2, 0,   -673.0,   0.0,    2.0,     14.0,  0.0,    0.0),
11579           new NutationModel( 0,-1,-2, 2, 0,    658.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11580 
11581        /* 121-130 */
11582           new NutationModel( 0, 3, 2,-2, 2,   -438.0,   0.0,    0.0,    188.0,  0.0,    0.0),
11583           new NutationModel( 0, 0, 0, 1, 1,   -390.0,   0.0,    0.0,    205.0,  0.0,    0.0),
11584           new NutationModel(-1, 0, 2, 2, 0,    639.0, -11.0,   -2.0,    -19.0,  0.0,    0.0),
11585           new NutationModel( 2, 1, 2, 0, 2,    412.0,   0.0,   -2.0,   -176.0,  0.0,   -1.0),
11586           new NutationModel( 1, 1, 0, 0, 1,   -361.0,   0.0,    0.0,    189.0,  0.0,    0.0),
11587           new NutationModel( 1, 1, 2, 0, 1,    360.0,   0.0,   -1.0,   -185.0,  0.0,   -1.0),
11588           new NutationModel( 2, 0, 0, 2, 0,    588.0,   0.0,   -3.0,    -24.0,  0.0,    0.0),
11589           new NutationModel( 1, 0,-2, 2, 0,   -578.0,   0.0,    1.0,      5.0,  0.0,    0.0),
11590           new NutationModel(-1, 0, 0, 2, 2,   -396.0,   0.0,    0.0,    171.0,  0.0,    0.0),
11591           new NutationModel( 0, 1, 0, 1, 0,    565.0,   0.0,   -1.0,     -6.0,  0.0,    0.0),
11592 
11593        /* 131-140 */
11594           new NutationModel( 0, 1, 0,-2, 1,   -335.0,   0.0,   -1.0,    184.0,  0.0,   -1.0),
11595           new NutationModel(-1, 0, 2,-2, 2,    357.0,   0.0,    1.0,   -154.0,  0.0,    0.0),
11596           new NutationModel( 0, 0, 0,-1, 1,    321.0,   0.0,    1.0,   -174.0,  0.0,    0.0),
11597           new NutationModel(-1, 1, 0, 0, 1,   -301.0,   0.0,   -1.0,    162.0,  0.0,    0.0),
11598           new NutationModel( 1, 0, 2,-1, 2,   -334.0,   0.0,    0.0,    144.0,  0.0,    0.0),
11599           new NutationModel( 1,-1, 0, 2, 0,    493.0,   0.0,   -2.0,    -15.0,  0.0,    0.0),
11600           new NutationModel( 0, 0, 0, 4, 0,    494.0,   0.0,   -2.0,    -19.0,  0.0,    0.0),
11601           new NutationModel( 1, 0, 2, 1, 2,    337.0,   0.0,   -1.0,   -143.0,  0.0,   -1.0),
11602           new NutationModel( 0, 0, 2, 1, 1,    280.0,   0.0,   -1.0,   -144.0,  0.0,    0.0),
11603           new NutationModel( 1, 0, 0,-2, 2,    309.0,   0.0,    1.0,   -134.0,  0.0,    0.0),
11604 
11605        /* 141-150 */
11606           new NutationModel(-1, 0, 2, 4, 1,   -263.0,   0.0,    2.0,    131.0,  0.0,    1.0),
11607           new NutationModel( 1, 0,-2, 0, 1,    253.0,   0.0,    1.0,   -138.0,  0.0,    0.0),
11608           new NutationModel( 1, 1, 2,-2, 1,    245.0,   0.0,    0.0,   -128.0,  0.0,    0.0),
11609           new NutationModel( 0, 0, 2, 2, 0,    416.0,   0.0,   -2.0,    -17.0,  0.0,    0.0),
11610           new NutationModel(-1, 0, 2,-1, 1,   -229.0,   0.0,    0.0,    128.0,  0.0,    0.0),
11611           new NutationModel(-2, 0, 2, 2, 1,    231.0,   0.0,    0.0,   -120.0,  0.0,    0.0),
11612           new NutationModel( 4, 0, 2, 0, 2,   -259.0,   0.0,    2.0,    109.0,  0.0,    1.0),
11613           new NutationModel( 2,-1, 0, 0, 0,    375.0,   0.0,   -1.0,     -8.0,  0.0,    0.0),
11614           new NutationModel( 2, 1, 2,-2, 2,    252.0,   0.0,    0.0,   -108.0,  0.0,    0.0),
11615           new NutationModel( 0, 1, 2, 1, 2,   -245.0,   0.0,    1.0,    104.0,  0.0,    0.0),
11616 
11617        /* 151-160 */
11618           new NutationModel( 1, 0, 4,-2, 2,    243.0,   0.0,   -1.0,   -104.0,  0.0,    0.0),
11619           new NutationModel(-1,-1, 0, 0, 1,    208.0,   0.0,    1.0,   -112.0,  0.0,    0.0),
11620           new NutationModel( 0, 1, 0, 2, 1,    199.0,   0.0,    0.0,   -102.0,  0.0,    0.0),
11621           new NutationModel(-2, 0, 2, 4, 1,   -208.0,   0.0,    1.0,    105.0,  0.0,    0.0),
11622           new NutationModel( 2, 0, 2, 0, 0,    335.0,   0.0,   -2.0,    -14.0,  0.0,    0.0),
11623           new NutationModel( 1, 0, 0, 1, 0,   -325.0,   0.0,    1.0,      7.0,  0.0,    0.0),
11624           new NutationModel(-1, 0, 0, 4, 1,   -187.0,   0.0,    0.0,     96.0,  0.0,    0.0),
11625           new NutationModel(-1, 0, 4, 0, 1,    197.0,   0.0,   -1.0,   -100.0,  0.0,    0.0),
11626           new NutationModel( 2, 0, 2, 2, 1,   -192.0,   0.0,    2.0,     94.0,  0.0,    1.0),
11627           new NutationModel( 0, 0, 2,-3, 2,   -188.0,   0.0,    0.0,     83.0,  0.0,    0.0),
11628 
11629        /* 161-170 */
11630           new NutationModel(-1,-2, 0, 2, 0,    276.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11631           new NutationModel( 2, 1, 0, 0, 0,   -286.0,   0.0,    1.0,      6.0,  0.0,    0.0),
11632           new NutationModel( 0, 0, 4, 0, 2,    186.0,   0.0,   -1.0,    -79.0,  0.0,    0.0),
11633           new NutationModel( 0, 0, 0, 0, 3,   -219.0,   0.0,    0.0,     43.0,  0.0,    0.0),
11634           new NutationModel( 0, 3, 0, 0, 0,    276.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11635           new NutationModel( 0, 0, 2,-4, 1,   -153.0,   0.0,   -1.0,     84.0,  0.0,    0.0),
11636           new NutationModel( 0,-1, 0, 2, 1,   -156.0,   0.0,    0.0,     81.0,  0.0,    0.0),
11637           new NutationModel( 0, 0, 0, 4, 1,   -154.0,   0.0,    1.0,     78.0,  0.0,    0.0),
11638           new NutationModel(-1,-1, 2, 4, 2,   -174.0,   0.0,    1.0,     75.0,  0.0,    0.0),
11639           new NutationModel( 1, 0, 2, 4, 2,   -163.0,   0.0,    2.0,     69.0,  0.0,    1.0),
11640 
11641        /* 171-180 */
11642           new NutationModel(-2, 2, 0, 2, 0,   -228.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11643           new NutationModel(-2,-1, 2, 0, 1,     91.0,   0.0,   -4.0,    -54.0,  0.0,   -2.0),
11644           new NutationModel(-2, 0, 0, 2, 2,    175.0,   0.0,    0.0,    -75.0,  0.0,    0.0),
11645           new NutationModel(-1,-1, 2, 0, 2,   -159.0,   0.0,    0.0,     69.0,  0.0,    0.0),
11646           new NutationModel( 0, 0, 4,-2, 1,    141.0,   0.0,    0.0,    -72.0,  0.0,    0.0),
11647           new NutationModel( 3, 0, 2,-2, 1,    147.0,   0.0,    0.0,    -75.0,  0.0,    0.0),
11648           new NutationModel(-2,-1, 0, 2, 1,   -132.0,   0.0,    0.0,     69.0,  0.0,    0.0),
11649           new NutationModel( 1, 0, 0,-1, 1,    159.0,   0.0,  -28.0,    -54.0,  0.0,   11.0),
11650           new NutationModel( 0,-2, 0, 2, 0,    213.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11651           new NutationModel(-2, 0, 0, 4, 1,    123.0,   0.0,    0.0,    -64.0,  0.0,    0.0),
11652 
11653        /* 181-190 */
11654           new NutationModel(-3, 0, 0, 0, 1,   -118.0,   0.0,   -1.0,     66.0,  0.0,    0.0),
11655           new NutationModel( 1, 1, 2, 2, 2,    144.0,   0.0,   -1.0,    -61.0,  0.0,    0.0),
11656           new NutationModel( 0, 0, 2, 4, 1,   -121.0,   0.0,    1.0,     60.0,  0.0,    0.0),
11657           new NutationModel( 3, 0, 2, 2, 2,   -134.0,   0.0,    1.0,     56.0,  0.0,    1.0),
11658           new NutationModel(-1, 1, 2,-2, 1,   -105.0,   0.0,    0.0,     57.0,  0.0,    0.0),
11659           new NutationModel( 2, 0, 0,-4, 1,   -102.0,   0.0,    0.0,     56.0,  0.0,    0.0),
11660           new NutationModel( 0, 0, 0,-2, 2,    120.0,   0.0,    0.0,    -52.0,  0.0,    0.0),
11661           new NutationModel( 2, 0, 2,-4, 1,    101.0,   0.0,    0.0,    -54.0,  0.0,    0.0),
11662           new NutationModel(-1, 1, 0, 2, 1,   -113.0,   0.0,    0.0,     59.0,  0.0,    0.0),
11663           new NutationModel( 0, 0, 2,-1, 1,   -106.0,   0.0,    0.0,     61.0,  0.0,    0.0),
11664 
11665        /* 191-200 */
11666           new NutationModel( 0,-2, 2, 2, 2,   -129.0,   0.0,    1.0,     55.0,  0.0,    0.0),
11667           new NutationModel( 2, 0, 0, 2, 1,   -114.0,   0.0,    0.0,     57.0,  0.0,    0.0),
11668           new NutationModel( 4, 0, 2,-2, 2,    113.0,   0.0,   -1.0,    -49.0,  0.0,    0.0),
11669           new NutationModel( 2, 0, 0,-2, 2,   -102.0,   0.0,    0.0,     44.0,  0.0,    0.0),
11670           new NutationModel( 0, 2, 0, 0, 1,    -94.0,   0.0,    0.0,     51.0,  0.0,    0.0),
11671           new NutationModel( 1, 0, 0,-4, 1,   -100.0,   0.0,   -1.0,     56.0,  0.0,    0.0),
11672           new NutationModel( 0, 2, 2,-2, 1,     87.0,   0.0,    0.0,    -47.0,  0.0,    0.0),
11673           new NutationModel(-3, 0, 0, 4, 0,    161.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11674           new NutationModel(-1, 1, 2, 0, 1,     96.0,   0.0,    0.0,    -50.0,  0.0,    0.0),
11675           new NutationModel(-1,-1, 0, 4, 0,    151.0,   0.0,   -1.0,     -5.0,  0.0,    0.0),
11676 
11677        /* 201-210 */
11678           new NutationModel(-1,-2, 2, 2, 2,   -104.0,   0.0,    0.0,     44.0,  0.0,    0.0),
11679           new NutationModel(-2,-1, 2, 4, 2,   -110.0,   0.0,    0.0,     48.0,  0.0,    0.0),
11680           new NutationModel( 1,-1, 2, 2, 1,   -100.0,   0.0,    1.0,     50.0,  0.0,    0.0),
11681           new NutationModel(-2, 1, 0, 2, 0,     92.0,   0.0,   -5.0,     12.0,  0.0,   -2.0),
11682           new NutationModel(-2, 1, 2, 0, 1,     82.0,   0.0,    0.0,    -45.0,  0.0,    0.0),
11683           new NutationModel( 2, 1, 0,-2, 1,     82.0,   0.0,    0.0,    -45.0,  0.0,    0.0),
11684           new NutationModel(-3, 0, 2, 0, 1,    -78.0,   0.0,    0.0,     41.0,  0.0,    0.0),
11685           new NutationModel(-2, 0, 2,-2, 1,    -77.0,   0.0,    0.0,     43.0,  0.0,    0.0),
11686           new NutationModel(-1, 1, 0, 2, 2,      2.0,   0.0,    0.0,     54.0,  0.0,    0.0),
11687           new NutationModel( 0,-1, 2,-1, 2,     94.0,   0.0,    0.0,    -40.0,  0.0,    0.0),
11688 
11689        /* 211-220 */
11690           new NutationModel(-1, 0, 4,-2, 2,    -93.0,   0.0,    0.0,     40.0,  0.0,    0.0),
11691           new NutationModel( 0,-2, 2, 0, 2,    -83.0,   0.0,   10.0,     40.0,  0.0,   -2.0),
11692           new NutationModel(-1, 0, 2, 1, 2,     83.0,   0.0,    0.0,    -36.0,  0.0,    0.0),
11693           new NutationModel( 2, 0, 0, 0, 2,    -91.0,   0.0,    0.0,     39.0,  0.0,    0.0),
11694           new NutationModel( 0, 0, 2, 0, 3,    128.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11695           new NutationModel(-2, 0, 4, 0, 2,    -79.0,   0.0,    0.0,     34.0,  0.0,    0.0),
11696           new NutationModel(-1, 0,-2, 0, 1,    -83.0,   0.0,    0.0,     47.0,  0.0,    0.0),
11697           new NutationModel(-1, 1, 2, 2, 1,     84.0,   0.0,    0.0,    -44.0,  0.0,    0.0),
11698           new NutationModel( 3, 0, 0, 0, 1,     83.0,   0.0,    0.0,    -43.0,  0.0,    0.0),
11699           new NutationModel(-1, 0, 2, 3, 2,     91.0,   0.0,    0.0,    -39.0,  0.0,    0.0),
11700 
11701        /* 221-230 */
11702           new NutationModel( 2,-1, 2, 0, 1,    -77.0,   0.0,    0.0,     39.0,  0.0,    0.0),
11703           new NutationModel( 0, 1, 2, 2, 1,     84.0,   0.0,    0.0,    -43.0,  0.0,    0.0),
11704           new NutationModel( 0,-1, 2, 4, 2,    -92.0,   0.0,    1.0,     39.0,  0.0,    0.0),
11705           new NutationModel( 2,-1, 2, 2, 2,    -92.0,   0.0,    1.0,     39.0,  0.0,    0.0),
11706           new NutationModel( 0, 2,-2, 2, 0,    -94.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11707           new NutationModel(-1,-1, 2,-1, 1,     68.0,   0.0,    0.0,    -36.0,  0.0,    0.0),
11708           new NutationModel( 0,-2, 0, 0, 1,    -61.0,   0.0,    0.0,     32.0,  0.0,    0.0),
11709           new NutationModel( 1, 0, 2,-4, 2,     71.0,   0.0,    0.0,    -31.0,  0.0,    0.0),
11710           new NutationModel( 1,-1, 0,-2, 1,     62.0,   0.0,    0.0,    -34.0,  0.0,    0.0),
11711           new NutationModel(-1,-1, 2, 0, 1,    -63.0,   0.0,    0.0,     33.0,  0.0,    0.0),
11712 
11713        /* 231-240 */
11714           new NutationModel( 1,-1, 2,-2, 2,    -73.0,   0.0,    0.0,     32.0,  0.0,    0.0),
11715           new NutationModel(-2,-1, 0, 4, 0,    115.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11716           new NutationModel(-1, 0, 0, 3, 0,   -103.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11717           new NutationModel(-2,-1, 2, 2, 2,     63.0,   0.0,    0.0,    -28.0,  0.0,    0.0),
11718           new NutationModel( 0, 2, 2, 0, 2,     74.0,   0.0,    0.0,    -32.0,  0.0,    0.0),
11719           new NutationModel( 1, 1, 0, 2, 0,   -103.0,   0.0,   -3.0,      3.0,  0.0,   -1.0),
11720           new NutationModel( 2, 0, 2,-1, 2,    -69.0,   0.0,    0.0,     30.0,  0.0,    0.0),
11721           new NutationModel( 1, 0, 2, 1, 1,     57.0,   0.0,    0.0,    -29.0,  0.0,    0.0),
11722           new NutationModel( 4, 0, 0, 0, 0,     94.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11723           new NutationModel( 2, 1, 2, 0, 1,     64.0,   0.0,    0.0,    -33.0,  0.0,    0.0),
11724 
11725        /* 241-250 */
11726           new NutationModel( 3,-1, 2, 0, 2,    -63.0,   0.0,    0.0,     26.0,  0.0,    0.0),
11727           new NutationModel(-2, 2, 0, 2, 1,    -38.0,   0.0,    0.0,     20.0,  0.0,    0.0),
11728           new NutationModel( 1, 0, 2,-3, 1,    -43.0,   0.0,    0.0,     24.0,  0.0,    0.0),
11729           new NutationModel( 1, 1, 2,-4, 1,    -45.0,   0.0,    0.0,     23.0,  0.0,    0.0),
11730           new NutationModel(-1,-1, 2,-2, 1,     47.0,   0.0,    0.0,    -24.0,  0.0,    0.0),
11731           new NutationModel( 0,-1, 0,-1, 1,    -48.0,   0.0,    0.0,     25.0,  0.0,    0.0),
11732           new NutationModel( 0,-1, 0,-2, 1,     45.0,   0.0,    0.0,    -26.0,  0.0,    0.0),
11733           new NutationModel(-2, 0, 0, 0, 2,     56.0,   0.0,    0.0,    -25.0,  0.0,    0.0),
11734           new NutationModel(-2, 0,-2, 2, 0,     88.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11735           new NutationModel(-1, 0,-2, 4, 0,    -75.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11736 
11737        /* 251-260 */
11738           new NutationModel( 1,-2, 0, 0, 0,     85.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11739           new NutationModel( 0, 1, 0, 1, 1,     49.0,   0.0,    0.0,    -26.0,  0.0,    0.0),
11740           new NutationModel(-1, 2, 0, 2, 0,    -74.0,   0.0,   -3.0,     -1.0,  0.0,   -1.0),
11741           new NutationModel( 1,-1, 2,-2, 1,    -39.0,   0.0,    0.0,     21.0,  0.0,    0.0),
11742           new NutationModel( 1, 2, 2,-2, 2,     45.0,   0.0,    0.0,    -20.0,  0.0,    0.0),
11743           new NutationModel( 2,-1, 2,-2, 2,     51.0,   0.0,    0.0,    -22.0,  0.0,    0.0),
11744           new NutationModel( 1, 0, 2,-1, 1,    -40.0,   0.0,    0.0,     21.0,  0.0,    0.0),
11745           new NutationModel( 2, 1, 2,-2, 1,     41.0,   0.0,    0.0,    -21.0,  0.0,    0.0),
11746           new NutationModel(-2, 0, 0,-2, 1,    -42.0,   0.0,    0.0,     24.0,  0.0,    0.0),
11747           new NutationModel( 1,-2, 2, 0, 2,    -51.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11748 
11749        /* 261-270 */
11750           new NutationModel( 0, 1, 2, 1, 1,    -42.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11751           new NutationModel( 1, 0, 4,-2, 1,     39.0,   0.0,    0.0,    -21.0,  0.0,    0.0),
11752           new NutationModel(-2, 0, 4, 2, 2,     46.0,   0.0,    0.0,    -18.0,  0.0,    0.0),
11753           new NutationModel( 1, 1, 2, 1, 2,    -53.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11754           new NutationModel( 1, 0, 0, 4, 0,     82.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11755           new NutationModel( 1, 0, 2, 2, 0,     81.0,   0.0,   -1.0,     -4.0,  0.0,    0.0),
11756           new NutationModel( 2, 0, 2, 1, 2,     47.0,   0.0,    0.0,    -19.0,  0.0,    0.0),
11757           new NutationModel( 3, 1, 2, 0, 2,     53.0,   0.0,    0.0,    -23.0,  0.0,    0.0),
11758           new NutationModel( 4, 0, 2, 0, 1,    -45.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11759           new NutationModel(-2,-1, 2, 0, 0,    -44.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11760 
11761        /* 271-280 */
11762           new NutationModel( 0, 1,-2, 2, 1,    -33.0,   0.0,    0.0,     16.0,  0.0,    0.0),
11763           new NutationModel( 1, 0,-2, 1, 0,    -61.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11764           new NutationModel( 0,-1,-2, 2, 1,     28.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11765           new NutationModel( 2,-1, 0,-2, 1,    -38.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11766           new NutationModel(-1, 0, 2,-1, 2,    -33.0,   0.0,    0.0,     21.0,  0.0,    0.0),
11767           new NutationModel( 1, 0, 2,-3, 2,    -60.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11768           new NutationModel( 0, 1, 2,-2, 3,     48.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11769           new NutationModel( 0, 0, 2,-3, 1,     27.0,   0.0,    0.0,    -14.0,  0.0,    0.0),
11770           new NutationModel(-1, 0,-2, 2, 1,     38.0,   0.0,    0.0,    -20.0,  0.0,    0.0),
11771           new NutationModel( 0, 0, 2,-4, 2,     31.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11772 
11773        /* 281-290 */
11774           new NutationModel(-2, 1, 0, 0, 1,    -29.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11775           new NutationModel(-1, 0, 0,-1, 1,     28.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11776           new NutationModel( 2, 0, 2,-4, 2,    -32.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11777           new NutationModel( 0, 0, 4,-4, 4,     45.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11778           new NutationModel( 0, 0, 4,-4, 2,    -44.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11779           new NutationModel(-1,-2, 0, 2, 1,     28.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11780           new NutationModel(-2, 0, 0, 3, 0,    -51.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11781           new NutationModel( 1, 0,-2, 2, 1,    -36.0,   0.0,    0.0,     20.0,  0.0,    0.0),
11782           new NutationModel(-3, 0, 2, 2, 2,     44.0,   0.0,    0.0,    -19.0,  0.0,    0.0),
11783           new NutationModel(-3, 0, 2, 2, 1,     26.0,   0.0,    0.0,    -14.0,  0.0,    0.0),
11784 
11785        /* 291-300 */
11786           new NutationModel(-2, 0, 2, 2, 0,    -60.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11787           new NutationModel( 2,-1, 0, 0, 1,     35.0,   0.0,    0.0,    -18.0,  0.0,    0.0),
11788           new NutationModel(-2, 1, 2, 2, 2,    -27.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11789           new NutationModel( 1, 1, 0, 1, 0,     47.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11790           new NutationModel( 0, 1, 4,-2, 2,     36.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11791           new NutationModel(-1, 1, 0,-2, 1,    -36.0,   0.0,    0.0,     20.0,  0.0,    0.0),
11792           new NutationModel( 0, 0, 0,-4, 1,    -35.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11793           new NutationModel( 1,-1, 0, 2, 1,    -37.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11794           new NutationModel( 1, 1, 0, 2, 1,     32.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11795           new NutationModel(-1, 2, 2, 2, 2,     35.0,   0.0,    0.0,    -14.0,  0.0,    0.0),
11796 
11797        /* 301-310 */
11798           new NutationModel( 3, 1, 2,-2, 2,     32.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11799           new NutationModel( 0,-1, 0, 4, 0,     65.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11800           new NutationModel( 2,-1, 0, 2, 0,     47.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11801           new NutationModel( 0, 0, 4, 0, 1,     32.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11802           new NutationModel( 2, 0, 4,-2, 2,     37.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11803           new NutationModel(-1,-1, 2, 4, 1,    -30.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11804           new NutationModel( 1, 0, 0, 4, 1,    -32.0,   0.0,    0.0,     16.0,  0.0,    0.0),
11805           new NutationModel( 1,-2, 2, 2, 2,    -31.0,   0.0,    0.0,     13.0,  0.0,    0.0),
11806           new NutationModel( 0, 0, 2, 3, 2,     37.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11807           new NutationModel(-1, 1, 2, 4, 2,     31.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11808 
11809        /* 311-320 */
11810           new NutationModel( 3, 0, 0, 2, 0,     49.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11811           new NutationModel(-1, 0, 4, 2, 2,     32.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11812           new NutationModel( 1, 1, 2, 2, 1,     23.0,   0.0,    0.0,    -12.0,  0.0,    0.0),
11813           new NutationModel(-2, 0, 2, 6, 2,    -43.0,   0.0,    0.0,     18.0,  0.0,    0.0),
11814           new NutationModel( 2, 1, 2, 2, 2,     26.0,   0.0,    0.0,    -11.0,  0.0,    0.0),
11815           new NutationModel(-1, 0, 2, 6, 2,    -32.0,   0.0,    0.0,     14.0,  0.0,    0.0),
11816           new NutationModel( 1, 0, 2, 4, 1,    -29.0,   0.0,    0.0,     14.0,  0.0,    0.0),
11817           new NutationModel( 2, 0, 2, 4, 2,    -27.0,   0.0,    0.0,     12.0,  0.0,    0.0),
11818           new NutationModel( 1, 1,-2, 1, 0,     30.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11819           new NutationModel(-3, 1, 2, 1, 2,    -11.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11820 
11821        /* 321-330 */
11822           new NutationModel( 2, 0,-2, 0, 2,    -21.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11823           new NutationModel(-1, 0, 0, 1, 2,    -34.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11824           new NutationModel(-4, 0, 2, 2, 1,    -10.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11825           new NutationModel(-1,-1, 0, 1, 0,    -36.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11826           new NutationModel( 0, 0,-2, 2, 2,     -9.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11827           new NutationModel( 1, 0, 0,-1, 2,    -12.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11828           new NutationModel( 0,-1, 2,-2, 3,    -21.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11829           new NutationModel(-2, 1, 2, 0, 0,    -29.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11830           new NutationModel( 0, 0, 2,-2, 4,    -15.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11831           new NutationModel(-2,-2, 0, 2, 0,    -20.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11832 
11833        /* 331-340 */
11834           new NutationModel(-2, 0,-2, 4, 0,     28.0,   0.0,    0.0,      0.0,  0.0,   -2.0),
11835           new NutationModel( 0,-2,-2, 2, 0,     17.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11836           new NutationModel( 1, 2, 0,-2, 1,    -22.0,   0.0,    0.0,     12.0,  0.0,    0.0),
11837           new NutationModel( 3, 0, 0,-4, 1,    -14.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11838           new NutationModel(-1, 1, 2,-2, 2,     24.0,   0.0,    0.0,    -11.0,  0.0,    0.0),
11839           new NutationModel( 1,-1, 2,-4, 1,     11.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11840           new NutationModel( 1, 1, 0,-2, 2,     14.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11841           new NutationModel(-3, 0, 2, 0, 0,     24.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11842           new NutationModel(-3, 0, 2, 0, 2,     18.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11843           new NutationModel(-2, 0, 0, 1, 0,    -38.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11844 
11845        /* 341-350 */
11846           new NutationModel( 0, 0,-2, 1, 0,    -31.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11847           new NutationModel(-3, 0, 0, 2, 1,    -16.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11848           new NutationModel(-1,-1,-2, 2, 0,     29.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11849           new NutationModel( 0, 1, 2,-4, 1,    -18.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11850           new NutationModel( 2, 1, 0,-4, 1,    -10.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11851           new NutationModel( 0, 2, 0,-2, 1,    -17.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11852           new NutationModel( 1, 0, 0,-3, 1,      9.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11853           new NutationModel(-2, 0, 2,-2, 2,     16.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11854           new NutationModel(-2,-1, 0, 0, 1,     22.0,   0.0,    0.0,    -12.0,  0.0,    0.0),
11855           new NutationModel(-4, 0, 0, 2, 0,     20.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11856 
11857        /* 351-360 */
11858           new NutationModel( 1, 1, 0,-4, 1,    -13.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11859           new NutationModel(-1, 0, 2,-4, 1,    -17.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11860           new NutationModel( 0, 0, 4,-4, 1,    -14.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11861           new NutationModel( 0, 3, 2,-2, 2,      0.0,   0.0,    0.0,     -7.0,  0.0,    0.0),
11862           new NutationModel(-3,-1, 0, 4, 0,     14.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11863           new NutationModel(-3, 0, 0, 4, 1,     19.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11864           new NutationModel( 1,-1,-2, 2, 0,    -34.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11865           new NutationModel(-1,-1, 0, 2, 2,    -20.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11866           new NutationModel( 1,-2, 0, 0, 1,      9.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11867           new NutationModel( 1,-1, 0, 0, 2,    -18.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11868 
11869        /* 361-370 */
11870           new NutationModel( 0, 0, 0, 1, 2,     13.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11871           new NutationModel(-1,-1, 2, 0, 0,     17.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11872           new NutationModel( 1,-2, 2,-2, 2,    -12.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11873           new NutationModel( 0,-1, 2,-1, 1,     15.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11874           new NutationModel(-1, 0, 2, 0, 3,    -11.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11875           new NutationModel( 1, 1, 0, 0, 2,     13.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11876           new NutationModel(-1, 1, 2, 0, 0,    -18.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11877           new NutationModel( 1, 2, 0, 0, 0,    -35.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11878           new NutationModel(-1, 2, 2, 0, 2,      9.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11879           new NutationModel(-1, 0, 4,-2, 1,    -19.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11880 
11881        /* 371-380 */
11882           new NutationModel( 3, 0, 2,-4, 2,    -26.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11883           new NutationModel( 1, 2, 2,-2, 1,      8.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11884           new NutationModel( 1, 0, 4,-4, 2,    -10.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11885           new NutationModel(-2,-1, 0, 4, 1,     10.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11886           new NutationModel( 0,-1, 0, 2, 2,    -21.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11887           new NutationModel(-2, 1, 0, 4, 0,    -15.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11888           new NutationModel(-2,-1, 2, 2, 1,      9.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11889           new NutationModel( 2, 0,-2, 2, 0,    -29.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11890           new NutationModel( 1, 0, 0, 1, 1,    -19.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11891           new NutationModel( 0, 1, 0, 2, 2,     12.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11892 
11893        /* 381-390 */
11894           new NutationModel( 1,-1, 2,-1, 2,     22.0,   0.0,    0.0,     -9.0,  0.0,    0.0),
11895           new NutationModel(-2, 0, 4, 0, 1,    -10.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11896           new NutationModel( 2, 1, 0, 0, 1,    -20.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11897           new NutationModel( 0, 1, 2, 0, 0,    -20.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11898           new NutationModel( 0,-1, 4,-2, 2,    -17.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11899           new NutationModel( 0, 0, 4,-2, 4,     15.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11900           new NutationModel( 0, 2, 2, 0, 1,      8.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11901           new NutationModel(-3, 0, 0, 6, 0,     14.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11902           new NutationModel(-1,-1, 0, 4, 1,    -12.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11903           new NutationModel( 1,-2, 0, 2, 0,     25.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11904 
11905        /* 391-400 */
11906           new NutationModel(-1, 0, 0, 4, 2,    -13.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11907           new NutationModel(-1,-2, 2, 2, 1,    -14.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11908           new NutationModel(-1, 0, 0,-2, 2,     13.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11909           new NutationModel( 1, 0,-2,-2, 1,    -17.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11910           new NutationModel( 0, 0,-2,-2, 1,    -12.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11911           new NutationModel(-2, 0,-2, 0, 1,    -10.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11912           new NutationModel( 0, 0, 0, 3, 1,     10.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11913           new NutationModel( 0, 0, 0, 3, 0,    -15.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11914           new NutationModel(-1, 1, 0, 4, 0,    -22.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11915           new NutationModel(-1,-1, 2, 2, 0,     28.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11916 
11917        /* 401-410 */
11918           new NutationModel(-2, 0, 2, 3, 2,     15.0,   0.0,    0.0,     -7.0,  0.0,    0.0),
11919           new NutationModel( 1, 0, 0, 2, 2,     23.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11920           new NutationModel( 0,-1, 2, 1, 2,     12.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11921           new NutationModel( 3,-1, 0, 0, 0,     29.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11922           new NutationModel( 2, 0, 0, 1, 0,    -25.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11923           new NutationModel( 1,-1, 2, 0, 0,     22.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11924           new NutationModel( 0, 0, 2, 1, 0,    -18.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11925           new NutationModel( 1, 0, 2, 0, 3,     15.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11926           new NutationModel( 3, 1, 0, 0, 0,    -23.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11927           new NutationModel( 3,-1, 2,-2, 2,     12.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11928 
11929        /* 411-420 */
11930           new NutationModel( 2, 0, 2,-1, 1,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11931           new NutationModel( 1, 1, 2, 0, 0,    -19.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11932           new NutationModel( 0, 0, 4,-1, 2,    -10.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11933           new NutationModel( 1, 2, 2, 0, 2,     21.0,   0.0,    0.0,     -9.0,  0.0,    0.0),
11934           new NutationModel(-2, 0, 0, 6, 0,     23.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11935           new NutationModel( 0,-1, 0, 4, 1,    -16.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11936           new NutationModel(-2,-1, 2, 4, 1,    -19.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11937           new NutationModel( 0,-2, 2, 2, 1,    -22.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11938           new NutationModel( 0,-1, 2, 2, 0,     27.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11939           new NutationModel(-1, 0, 2, 3, 1,     16.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11940 
11941        /* 421-430 */
11942           new NutationModel(-2, 1, 2, 4, 2,     19.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11943           new NutationModel( 2, 0, 0, 2, 2,      9.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11944           new NutationModel( 2,-2, 2, 0, 2,     -9.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11945           new NutationModel(-1, 1, 2, 3, 2,     -9.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11946           new NutationModel( 3, 0, 2,-1, 2,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11947           new NutationModel( 4, 0, 2,-2, 1,     18.0,   0.0,    0.0,     -9.0,  0.0,    0.0),
11948           new NutationModel(-1, 0, 0, 6, 0,     16.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11949           new NutationModel(-1,-2, 2, 4, 2,    -10.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11950           new NutationModel(-3, 0, 2, 6, 2,    -23.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11951           new NutationModel(-1, 0, 2, 4, 0,     16.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11952 
11953        /* 431-440 */
11954           new NutationModel( 3, 0, 0, 2, 1,    -12.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11955           new NutationModel( 3,-1, 2, 0, 1,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11956           new NutationModel( 3, 0, 2, 0, 0,     30.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11957           new NutationModel( 1, 0, 4, 0, 2,     24.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11958           new NutationModel( 5, 0, 2,-2, 2,     10.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11959           new NutationModel( 0,-1, 2, 4, 1,    -16.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11960           new NutationModel( 2,-1, 2, 2, 1,    -16.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11961           new NutationModel( 0, 1, 2, 4, 2,     17.0,   0.0,    0.0,     -7.0,  0.0,    0.0),
11962           new NutationModel( 1,-1, 2, 4, 2,    -24.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11963           new NutationModel( 3,-1, 2, 2, 2,    -12.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11964 
11965        /* 441-450 */
11966           new NutationModel( 3, 0, 2, 2, 1,    -24.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11967           new NutationModel( 5, 0, 2, 0, 2,    -23.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11968           new NutationModel( 0, 0, 2, 6, 2,    -13.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11969           new NutationModel( 4, 0, 2, 2, 2,    -15.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11970           new NutationModel( 0,-1, 1,-1, 1,      0.0,   0.0,-1988.0,      0.0,  0.0,-1679.0),
11971           new NutationModel(-1, 0, 1, 0, 3,      0.0,   0.0,  -63.0,      0.0,  0.0,  -27.0),
11972           new NutationModel( 0,-2, 2,-2, 3,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11973           new NutationModel( 1, 0,-1, 0, 1,      0.0,   0.0,    5.0,      0.0,  0.0,    4.0),
11974           new NutationModel( 2,-2, 0,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11975           new NutationModel(-1, 0, 1, 0, 2,      0.0,   0.0,  364.0,      0.0,  0.0,  176.0),
11976 
11977        /* 451-460 */
11978           new NutationModel(-1, 0, 1, 0, 1,      0.0,   0.0,-1044.0,      0.0,  0.0, -891.0),
11979           new NutationModel(-1,-1, 2,-1, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11980           new NutationModel(-2, 2, 0, 2, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11981           new NutationModel(-1, 0, 1, 0, 0,      0.0,   0.0,  330.0,      0.0,  0.0,    0.0),
11982           new NutationModel(-4, 1, 2, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11983           new NutationModel(-3, 0, 2, 1, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11984           new NutationModel(-2,-1, 2, 0, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11985           new NutationModel( 1, 0,-2, 1, 1,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11986           new NutationModel( 2,-1,-2, 0, 1,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11987           new NutationModel(-4, 0, 2, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11988 
11989        /* 461-470 */
11990           new NutationModel(-3, 1, 0, 3, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11991           new NutationModel(-1, 0,-1, 2, 0,      0.0,   0.0,    5.0,      0.0,  0.0,    0.0),
11992           new NutationModel( 0,-2, 0, 0, 2,      0.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11993           new NutationModel( 0,-2, 0, 0, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11994           new NutationModel(-3, 0, 0, 3, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11995           new NutationModel(-2,-1, 0, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11996           new NutationModel(-1, 0,-2, 3, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11997           new NutationModel(-4, 0, 0, 4, 0,    -12.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11998           new NutationModel( 2, 1,-2, 0, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11999           new NutationModel( 2,-1, 0,-2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12000 
12001        /* 471-480 */
12002           new NutationModel( 0, 0, 1,-1, 0,     -5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12003           new NutationModel(-1, 2, 0, 1, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12004           new NutationModel(-2, 1, 2, 0, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12005           new NutationModel( 1, 1, 0,-1, 1,      7.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
12006           new NutationModel( 1, 0, 1,-2, 1,      0.0,   0.0,  -12.0,      0.0,  0.0,  -10.0),
12007           new NutationModel( 0, 2, 0, 0, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12008           new NutationModel( 1,-1, 2,-3, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12009           new NutationModel(-1, 1, 2,-1, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12010           new NutationModel(-2, 0, 4,-2, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12011           new NutationModel(-2, 0, 4,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12012 
12013        /* 481-490 */
12014           new NutationModel(-2,-2, 0, 2, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12015           new NutationModel(-2, 0,-2, 4, 0,      0.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12016           new NutationModel( 1, 2, 2,-4, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12017           new NutationModel( 1, 1, 2,-4, 2,      7.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12018           new NutationModel(-1, 2, 2,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12019           new NutationModel( 2, 0, 0,-3, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12020           new NutationModel(-1, 2, 0, 0, 1,     -5.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12021           new NutationModel( 0, 0, 0,-2, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12022           new NutationModel(-1,-1, 2,-2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12023           new NutationModel(-1, 1, 0, 0, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12024 
12025        /* 491-500 */
12026           new NutationModel( 0, 0, 0,-1, 2,     -8.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12027           new NutationModel(-2, 1, 0, 1, 0,      9.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12028           new NutationModel( 1,-2, 0,-2, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12029           new NutationModel( 1, 0,-2, 0, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12030           new NutationModel(-3, 1, 0, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12031           new NutationModel(-1, 1,-2, 2, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12032           new NutationModel(-1,-1, 0, 0, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12033           new NutationModel(-3, 0, 0, 2, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12034           new NutationModel(-3,-1, 0, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12035           new NutationModel( 2, 0, 2,-6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12036 
12037        /* 501-510 */
12038           new NutationModel( 0, 1, 2,-4, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12039           new NutationModel( 2, 0, 0,-4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12040           new NutationModel(-2, 1, 2,-2, 1,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12041           new NutationModel( 0,-1, 2,-4, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12042           new NutationModel( 0, 1, 0,-2, 2,      9.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12043           new NutationModel(-1, 0, 0,-2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12044           new NutationModel( 2, 0,-2,-2, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12045           new NutationModel(-4, 0, 2, 0, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12046           new NutationModel(-1,-1, 0,-1, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12047           new NutationModel( 0, 0,-2, 0, 2,      9.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12048 
12049        /* 511-520 */
12050           new NutationModel(-3, 0, 0, 1, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12051           new NutationModel(-1, 0,-2, 1, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12052           new NutationModel(-2, 0,-2, 2, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12053           new NutationModel( 0, 0,-4, 2, 0,      8.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12054           new NutationModel(-2,-1,-2, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12055           new NutationModel( 1, 0, 2,-6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12056           new NutationModel(-1, 0, 2,-4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12057           new NutationModel( 1, 0, 0,-4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12058           new NutationModel( 2, 1, 2,-4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12059           new NutationModel( 2, 1, 2,-4, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12060 
12061        /* 521-530 */
12062           new NutationModel( 0, 1, 4,-4, 4,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12063           new NutationModel( 0, 1, 4,-4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12064           new NutationModel(-1,-1,-2, 4, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12065           new NutationModel(-1,-3, 0, 2, 0,      9.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12066           new NutationModel(-1, 0,-2, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12067           new NutationModel(-2,-1, 0, 3, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12068           new NutationModel( 0, 0,-2, 3, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12069           new NutationModel(-2, 0, 0, 3, 1,     -5.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12070           new NutationModel( 0,-1, 0, 1, 0,    -13.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12071           new NutationModel(-3, 0, 2, 2, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12072 
12073        /* 531-540 */
12074           new NutationModel( 1, 1,-2, 2, 0,     10.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12075           new NutationModel(-1, 1, 0, 2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12076           new NutationModel( 1,-2, 2,-2, 1,     10.0,   0.0,   13.0,      6.0,  0.0,   -5.0),
12077           new NutationModel( 0, 0, 1, 0, 2,      0.0,   0.0,   30.0,      0.0,  0.0,   14.0),
12078           new NutationModel( 0, 0, 1, 0, 1,      0.0,   0.0, -162.0,      0.0,  0.0, -138.0),
12079           new NutationModel( 0, 0, 1, 0, 0,      0.0,   0.0,   75.0,      0.0,  0.0,    0.0),
12080           new NutationModel(-1, 2, 0, 2, 1,     -7.0,   0.0,    0.0,      4.0,  0.0,    0.0),
12081           new NutationModel( 0, 0, 2, 0, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12082           new NutationModel(-2, 0, 2, 0, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12083           new NutationModel( 2, 0, 0,-1, 1,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12084 
12085        /* 541-550 */
12086           new NutationModel( 3, 0, 0,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12087           new NutationModel( 1, 0, 2,-2, 3,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12088           new NutationModel( 1, 2, 0, 0, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12089           new NutationModel( 2, 0, 2,-3, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12090           new NutationModel(-1, 1, 4,-2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12091           new NutationModel(-2,-2, 0, 4, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12092           new NutationModel( 0,-3, 0, 2, 0,      9.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12093           new NutationModel( 0, 0,-2, 4, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12094           new NutationModel(-1,-1, 0, 3, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12095           new NutationModel(-2, 0, 0, 4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12096 
12097        /* 551-560 */
12098           new NutationModel(-1, 0, 0, 3, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12099           new NutationModel( 2,-2, 0, 0, 0,      7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12100           new NutationModel( 1,-1, 0, 1, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12101           new NutationModel(-1, 0, 0, 2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12102           new NutationModel( 0,-2, 2, 0, 1,     -6.0,   0.0,   -3.0,      3.0,  0.0,    1.0),
12103           new NutationModel(-1, 0, 1, 2, 1,      0.0,   0.0,   -3.0,      0.0,  0.0,   -2.0),
12104           new NutationModel(-1, 1, 0, 3, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12105           new NutationModel(-1,-1, 2, 1, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12106           new NutationModel( 0,-1, 2, 0, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12107           new NutationModel(-2, 1, 2, 2, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12108 
12109        /* 561-570 */
12110           new NutationModel( 2,-2, 2,-2, 2,     -1.0,   0.0,    3.0,      3.0,  0.0,   -1.0),
12111           new NutationModel( 1, 1, 0, 1, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12112           new NutationModel( 1, 0, 1, 0, 1,      0.0,   0.0,  -13.0,      0.0,  0.0,  -11.0),
12113           new NutationModel( 1, 0, 1, 0, 0,      3.0,   0.0,    6.0,      0.0,  0.0,    0.0),
12114           new NutationModel( 0, 2, 0, 2, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12115           new NutationModel( 2,-1, 2,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12116           new NutationModel( 0,-1, 4,-2, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12117           new NutationModel( 0, 0, 4,-2, 3,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12118           new NutationModel( 0, 1, 4,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12119           new NutationModel( 4, 0, 2,-4, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12120 
12121        /* 571-580 */
12122           new NutationModel( 2, 2, 2,-2, 2,      8.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12123           new NutationModel( 2, 0, 4,-4, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12124           new NutationModel(-1,-2, 0, 4, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12125           new NutationModel(-1,-3, 2, 2, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12126           new NutationModel(-3, 0, 2, 4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12127           new NutationModel(-3, 0, 2,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12128           new NutationModel(-1,-1, 0,-2, 1,      8.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
12129           new NutationModel(-3, 0, 0, 0, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12130           new NutationModel(-3, 0,-2, 2, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12131           new NutationModel( 0, 1, 0,-4, 1,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12132 
12133        /* 581-590 */
12134           new NutationModel(-2, 1, 0,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12135           new NutationModel(-4, 0, 0, 0, 1,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
12136           new NutationModel(-1, 0, 0,-4, 1,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12137           new NutationModel(-3, 0, 0,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12138           new NutationModel( 0, 0, 0, 3, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12139           new NutationModel(-1, 1, 0, 4, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12140           new NutationModel( 1,-2, 2, 0, 1,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12141           new NutationModel( 0, 1, 0, 3, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12142           new NutationModel(-1, 0, 2, 2, 3,      6.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12143           new NutationModel( 0, 0, 2, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12144 
12145        /* 591-600 */
12146           new NutationModel(-2, 0, 2, 2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12147           new NutationModel(-1, 1, 2, 2, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12148           new NutationModel( 3, 0, 0, 0, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12149           new NutationModel( 2, 1, 0, 1, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12150           new NutationModel( 2,-1, 2,-1, 2,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12151           new NutationModel( 0, 0, 2, 0, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12152           new NutationModel( 0, 0, 3, 0, 3,      0.0,   0.0,  -26.0,      0.0,  0.0,  -11.0),
12153           new NutationModel( 0, 0, 3, 0, 2,      0.0,   0.0,  -10.0,      0.0,  0.0,   -5.0),
12154           new NutationModel(-1, 2, 2, 2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12155           new NutationModel(-1, 0, 4, 0, 0,    -13.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12156 
12157        /* 601-610 */
12158           new NutationModel( 1, 2, 2, 0, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12159           new NutationModel( 3, 1, 2,-2, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12160           new NutationModel( 1, 1, 4,-2, 2,      7.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12161           new NutationModel(-2,-1, 0, 6, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12162           new NutationModel( 0,-2, 0, 4, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12163           new NutationModel(-2, 0, 0, 6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12164           new NutationModel(-2,-2, 2, 4, 2,     -6.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12165           new NutationModel( 0,-3, 2, 2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12166           new NutationModel( 0, 0, 0, 4, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12167           new NutationModel(-1,-1, 2, 3, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12168 
12169        /* 611-620 */
12170           new NutationModel(-2, 0, 2, 4, 0,     13.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12171           new NutationModel( 2,-1, 0, 2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12172           new NutationModel( 1, 0, 0, 3, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12173           new NutationModel( 0, 1, 0, 4, 1,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12174           new NutationModel( 0, 1, 0, 4, 0,    -11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12175           new NutationModel( 1,-1, 2, 1, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12176           new NutationModel( 0, 0, 2, 2, 3,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12177           new NutationModel( 1, 0, 2, 2, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12178           new NutationModel(-1, 0, 2, 2, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12179           new NutationModel(-2, 0, 4, 2, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12180 
12181        /* 621-630 */
12182           new NutationModel( 2, 1, 0, 2, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12183           new NutationModel( 2, 1, 0, 2, 0,    -12.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12184           new NutationModel( 2,-1, 2, 0, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12185           new NutationModel( 1, 0, 2, 1, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12186           new NutationModel( 0, 1, 2, 2, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12187           new NutationModel( 2, 0, 2, 0, 3,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12188           new NutationModel( 3, 0, 2, 0, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12189           new NutationModel( 1, 0, 2, 0, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12190           new NutationModel( 1, 0, 3, 0, 3,      0.0,   0.0,   -5.0,      0.0,  0.0,   -2.0),
12191           new NutationModel( 1, 1, 2, 1, 1,     -7.0,   0.0,    0.0,      4.0,  0.0,    0.0),
12192 
12193        /* 631-640 */
12194           new NutationModel( 0, 2, 2, 2, 2,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12195           new NutationModel( 2, 1, 2, 0, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12196           new NutationModel( 2, 0, 4,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12197           new NutationModel( 4, 1, 2,-2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12198           new NutationModel(-1,-1, 0, 6, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12199           new NutationModel(-3,-1, 2, 6, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12200           new NutationModel(-1, 0, 0, 6, 1,     -5.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12201           new NutationModel(-3, 0, 2, 6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12202           new NutationModel( 1,-1, 0, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12203           new NutationModel( 1,-1, 0, 4, 0,     12.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12204 
12205        /* 641-650 */
12206           new NutationModel(-2, 0, 2, 5, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12207           new NutationModel( 1,-2, 2, 2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12208           new NutationModel( 3,-1, 0, 2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12209           new NutationModel( 1,-1, 2, 2, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12210           new NutationModel( 0, 0, 2, 3, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12211           new NutationModel(-1, 1, 2, 4, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12212           new NutationModel( 0, 1, 2, 3, 2,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12213           new NutationModel(-1, 0, 4, 2, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12214           new NutationModel( 2, 0, 2, 1, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12215           new NutationModel( 5, 0, 0, 0, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12216 
12217        /* 651-660 */
12218           new NutationModel( 2, 1, 2, 1, 2,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12219           new NutationModel( 1, 0, 4, 0, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12220           new NutationModel( 3, 1, 2, 0, 1,      7.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
12221           new NutationModel( 3, 0, 4,-2, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12222           new NutationModel(-2,-1, 2, 6, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12223           new NutationModel( 0, 0, 0, 6, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12224           new NutationModel( 0,-2, 2, 4, 2,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12225           new NutationModel(-2, 0, 2, 6, 1,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12226           new NutationModel( 2, 0, 0, 4, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12227           new NutationModel( 2, 0, 0, 4, 0,     10.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12228 
12229        /* 661-670 */
12230           new NutationModel( 2,-2, 2, 2, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12231           new NutationModel( 0, 0, 2, 4, 0,      7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12232           new NutationModel( 1, 0, 2, 3, 2,      7.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12233           new NutationModel( 4, 0, 0, 2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12234           new NutationModel( 2, 0, 2, 2, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12235           new NutationModel( 0, 0, 4, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12236           new NutationModel( 4,-1, 2, 0, 2,     -6.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12237           new NutationModel( 3, 0, 2, 1, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12238           new NutationModel( 2, 1, 2, 2, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12239           new NutationModel( 4, 1, 2, 0, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12240 
12241        /* 671-678 */
12242           new NutationModel(-1,-1, 2, 6, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12243           new NutationModel(-1, 0, 2, 6, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12244           new NutationModel( 1,-1, 2, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12245           new NutationModel( 1, 1, 2, 4, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12246           new NutationModel( 3, 1, 2, 2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12247           new NutationModel( 5, 0, 2, 0, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12248           new NutationModel( 2,-1, 2, 4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12249           new NutationModel( 2, 0, 2, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0)
12250        };
12251 
12252     /* Number of terms in the luni-solar nutation model */
12253        final int NLS = xls.length;
12254 
12255     /* ------------------------
12256     /* Planetary nutation model */
12257     /* ------------------------ */
12258 
12259     /* The units for the sine and cosine coefficients are */
12260     /* 0.1 microarcsecond                                 */
12261 
12262        
12263        PlanetaryNutModel xpl[] = {
12264 
12265        /* 1-10 */
12266           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  8,-16, 4, 5, 0, 0, 0, 1440,   0,    0,   0),
12267           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -8, 16,-4,-5, 0, 0, 2,   56,-117,  -42, -40),
12268           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  8,-16, 4, 5, 0, 0, 2,  125, -43,    0, -54),
12269           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0,-1, 2, 2,    0,   5,    0,   0),
12270           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  8,-1,-5, 0, 0, 2,    3,  -7,   -3,   0),
12271           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 1,    3,   0,    0,  -2),
12272           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  3, -8, 3, 0, 0, 0, 0, -114,   0,    0,  61),
12273           new PlanetaryNutModel(-1, 0, 0, 0, 0, 10, -3,  0, 0, 0, 0, 0, 0, -219,  89,    0,   0),
12274           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-2, 6,-3, 0, 2,   -3,   0,    0,   0),
12275           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0, -462,1604,    0,   0),
12276 
12277        /* 11-20 */
12278           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -5,  8,-3, 0, 0, 0, 0,   99,   0,    0, -53),
12279           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  8,-3, 0, 0, 0, 1,   -3,   0,    0,   2),
12280           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 1, 5, 0, 0, 2,    0,   6,    2,   0),
12281           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  6,  4, 0, 0, 0, 0, 2,    3,   0,    0,   0),
12282           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-5, 0, 0, 2,  -12,   0,    0,   0),
12283           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-5, 0, 0, 1,   14,-218,  117,   8),
12284           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 2,-5, 0, 0, 0,   31,-481, -257, -17),
12285           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-5, 0, 0, 0, -491, 128,    0,   0),
12286           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-2, 5, 0, 0, 0,-3084,5123, 2735,1647),
12287           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-2, 5, 0, 0, 1,-1444,2409,-1286,-771),
12288 
12289        /* 21-30 */
12290           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-2, 5, 0, 0, 2,   11, -24,  -11,  -9),
12291           new PlanetaryNutModel( 2,-1,-1, 0, 0,  0,  3, -7, 0, 0, 0, 0, 0,   26,  -9,    0,   0),
12292           new PlanetaryNutModel( 1, 0,-2, 0, 0, 19,-21,  3, 0, 0, 0, 0, 0,  103, -60,    0,   0),
12293           new PlanetaryNutModel( 0, 1,-1, 1, 0,  2, -4,  0,-3, 0, 0, 0, 0,    0, -13,   -7,   0),
12294           new PlanetaryNutModel( 1, 0,-1, 1, 0,  0, -1,  0, 2, 0, 0, 0, 0,  -26, -29,  -16,  14),
12295           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-4,10, 0, 0, 0,    9, -27,  -14,  -5),
12296           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0, 0,-5, 0, 0, 0,   12,   0,    0,  -6),
12297           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -7,  4, 0, 0, 0, 0, 0,   -7,   0,    0,   0),
12298           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 1,-1, 0, 0, 0,    0,  24,    0,   0),
12299           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-2, 0, 0, 0, 0,  284,   0,    0,-151),
12300 
12301        /* 31-40 */
12302           new PlanetaryNutModel(-1, 0, 0, 0, 0, 18,-16,  0, 0, 0, 0, 0, 0,  226, 101,    0,   0),
12303           new PlanetaryNutModel(-2, 1, 1, 2, 0,  0,  1,  0,-2, 0, 0, 0, 0,    0,  -8,   -2,   0),
12304           new PlanetaryNutModel(-1, 1,-1, 1, 0, 18,-17,  0, 0, 0, 0, 0, 0,    0,  -6,   -3,   0),
12305           new PlanetaryNutModel(-1, 0, 1, 1, 0,  0,  2, -2, 0, 0, 0, 0, 0,    5,   0,    0,  -3),
12306           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 13,  0, 0, 0, 0, 0, 2,  -41, 175,   76,  17),
12307           new PlanetaryNutModel( 0, 2,-2, 2, 0, -8, 11,  0, 0, 0, 0, 0, 0,    0,  15,    6,   0),
12308           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 13,  0, 0, 0, 0, 0, 1,  425, 212, -133, 269),
12309           new PlanetaryNutModel( 0, 1,-1, 1, 0, -8, 12,  0, 0, 0, 0, 0, 0, 1200, 598,  319,-641),
12310           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8,-13,  0, 0, 0, 0, 0, 0,  235, 334,    0,   0),
12311           new PlanetaryNutModel( 0, 1,-1, 1, 0,  8,-14,  0, 0, 0, 0, 0, 0,   11, -12,   -7,  -6),
12312 
12313        /* 41-50 */
12314           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8,-13,  0, 0, 0, 0, 0, 1,    5,  -6,    3,   3),
12315           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-4, 5, 0, 0, 0,   -5,   0,    0,   3),
12316           new PlanetaryNutModel(-2, 0, 2, 2, 0,  3, -3,  0, 0, 0, 0, 0, 0,    6,   0,    0,  -3),
12317           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-3, 1, 0, 0, 0,   15,   0,    0,   0),
12318           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -5,  0, 2, 0, 0, 0, 0,   13,   0,    0,  -7),
12319           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-4, 3, 0, 0, 0,   -6,  -9,    0,   0),
12320           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  0,  2, 0, 0, 0, 0, 0,  266, -78,    0,   0),
12321           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -1,  2, 0, 0, 0, 0, 0, -460,-435, -232, 246),
12322           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -2,  2, 0, 0, 0, 0, 0,    0,  15,    7,   0),
12323           new PlanetaryNutModel(-1, 1, 0, 1, 0,  3, -5,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12324 
12325        /* 51-60 */
12326           new PlanetaryNutModel(-1, 0, 1, 0, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0, 131,    0,   0),
12327           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-2,-2, 0, 0, 0,    4,   0,    0,   0),
12328           new PlanetaryNutModel(-2, 2, 0, 2, 0,  0, -5,  9, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12329           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 0,-1, 0, 0,    0,   4,    2,   0),
12330           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 1, 0, 0,    0,   3,    0,   0),
12331           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 0, 0, 2, 0,  -17, -19,  -10,   9),
12332           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 0, 2, 1,   -9, -11,    6,  -5),
12333           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 0, 2, 2,   -6,   0,    0,   3),
12334           new PlanetaryNutModel(-1, 0, 1, 0, 0,  0,  3, -4, 0, 0, 0, 0, 0,  -16,   8,    0,   0),
12335           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0, 2, 0, 0, 0,    0,   3,    0,   0),
12336 
12337        /* 61-70 */
12338           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 0, 2, 0, 0, 0,   11,  24,   11,  -5),
12339           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -9, 17, 0, 0, 0, 0, 0,   -3,  -4,   -2,   1),
12340           new PlanetaryNutModel( 0, 0, 0, 2, 0, -3,  5,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12341           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-1, 2, 0, 0, 0,    0,  -8,   -4,   0),
12342           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1,-2, 0, 0, 0,    0,   3,    0,   0),
12343           new PlanetaryNutModel( 1, 0,-2, 0, 0, 17,-16,  0,-2, 0, 0, 0, 0,    0,   5,    0,   0),
12344           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 1,-3, 0, 0, 0,    0,   3,    2,   0),
12345           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  5, -6, 0, 0, 0, 0, 0,   -6,   4,    2,   3),
12346           new PlanetaryNutModel( 0,-2, 2, 0, 0,  0,  9,-13, 0, 0, 0, 0, 0,   -3,  -5,    0,   0),
12347           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 0, 1, 0, 0, 0,   -5,   0,    0,   2),
12348 
12349        /* 71-80 */
12350           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 0, 1, 0, 0, 0,    4,  24,   13,  -2),
12351           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0, 1, 0, 0, 0,  -42,  20,    0,   0),
12352           new PlanetaryNutModel( 0,-2, 2, 0, 0,  5, -6,  0, 0, 0, 0, 0, 0,  -10, 233,    0,   0),
12353           new PlanetaryNutModel( 0,-1, 1, 1, 0,  5, -7,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12354           new PlanetaryNutModel(-2, 0, 2, 0, 0,  6, -8,  0, 0, 0, 0, 0, 0,   78, -18,    0,   0),
12355           new PlanetaryNutModel( 2, 1,-3, 1, 0, -6,  7,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12356           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0,  0,  0, 1, 0, 0, 0, 0,    0,  -3,   -1,   0),
12357           new PlanetaryNutModel( 0,-1, 1, 1, 0,  0,  1,  0, 1, 0, 0, 0, 0,    0,  -4,   -2,   1),
12358           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 0, 2, 0, 0,    0,  -8,   -4,  -1),
12359           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 2, 0, 1,    0,  -5,    3,   0),
12360 
12361        /* 81-90 */
12362           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 2, 0, 2,   -7,   0,    0,   3),
12363           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -8, 15, 0, 0, 0, 0, 2,  -14,   8,    3,   6),
12364           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -8, 15, 0, 0, 0, 0, 1,    0,   8,   -4,   0),
12365           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -9, 15, 0, 0, 0, 0, 0,    0,  19,   10,   0),
12366           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  8,-15, 0, 0, 0, 0, 0,   45, -22,    0,   0),
12367           new PlanetaryNutModel( 1,-1,-1, 0, 0,  0,  8,-15, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12368           new PlanetaryNutModel( 2, 0,-2, 0, 0,  2, -5,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12369           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-5, 5, 0, 0, 0,    0,   3,    0,   0),
12370           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -6,  8, 0, 0, 0, 0, 0,    3,   5,    3,  -2),
12371           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -2,  0, 3, 0, 0, 0, 0,   89, -16,   -9, -48),
12372 
12373        /* 91-100 */
12374           new PlanetaryNutModel(-2, 1, 1, 0, 0,  0,  1,  0,-3, 0, 0, 0, 0,    0,   3,    0,   0),
12375           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0,  1,  0,-3, 0, 0, 0, 0,   -3,   7,    4,   2),
12376           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0, -349, -62,    0,   0),
12377           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  6, -8, 0, 0, 0, 0, 0,  -15,  22,    0,   0),
12378           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-1,-5, 0, 0, 0,   -3,   0,    0,   0),
12379           new PlanetaryNutModel(-1, 0, 1, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,  -53,   0,    0,   0),
12380           new PlanetaryNutModel(-1, 1, 1, 1, 0,-20, 20,  0, 0, 0, 0, 0, 0,    5,   0,    0,  -3),
12381           new PlanetaryNutModel( 1, 0,-2, 0, 0, 20,-21,  0, 0, 0, 0, 0, 0,    0,  -8,    0,   0),
12382           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  8,-15, 0, 0, 0, 0, 0,   15,  -7,   -4,  -8),
12383           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0,-10, 15, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12384 
12385        /* 101-110 */
12386           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 1, 0, 0, 0, 0,  -21, -78,    0,   0),
12387           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 1, 0, 0, 0, 0,   20, -70,  -37, -11),
12388           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 1, 0, 0, 0, 0,    0,   6,    3,   0),
12389           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-2, 4, 0, 0, 0,    5,   3,    2,  -2),
12390           new PlanetaryNutModel( 2, 0,-2, 1, 0, -6,  8,  0, 0, 0, 0, 0, 0,  -17,  -4,   -2,   9),
12391           new PlanetaryNutModel( 0,-2, 2, 1, 0,  5, -6,  0, 0, 0, 0, 0, 0,    0,   6,    3,   0),
12392           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0,-1, 0, 0, 1,   32,  15,   -8,  17),
12393           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0,-1, 0, 0, 0,  174,  84,   45, -93),
12394           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 1, 0, 0, 0,   11,  56,    0,   0),
12395           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 1, 0, 0, 0,  -66, -12,   -6,  35),
12396 
12397        /* 111-120 */
12398           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 1, 0, 0, 1,   47,   8,    4, -25),
12399           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 1, 0, 0, 2,    0,   8,    4,   0),
12400           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -9, 13, 0, 0, 0, 0, 0,   10, -22,  -12,  -5),
12401           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  7,-13, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12402           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  5, -6, 0, 0, 0, 0, 0,  -24,  12,    0,   0),
12403           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  9,-17, 0, 0, 0, 0, 0,    5,  -6,    0,   0),
12404           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -9, 17, 0, 0, 0, 0, 2,    3,   0,    0,  -2),
12405           new PlanetaryNutModel( 1, 0,-1, 1, 0,  0, -3,  4, 0, 0, 0, 0, 0,    4,   3,    1,  -2),
12406           new PlanetaryNutModel( 1, 0,-1, 1, 0, -3,  4,  0, 0, 0, 0, 0, 0,    0,  29,   15,   0),
12407           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0, -1,  2, 0, 0, 0, 0, 0,   -5,  -4,   -2,   2),
12408 
12409        /* 121-130 */
12410           new PlanetaryNutModel( 0,-1, 1, 1, 0,  0,  0,  2, 0, 0, 0, 0, 0,    8,  -3,   -1,  -5),
12411           new PlanetaryNutModel( 0,-2, 2, 0, 1,  0, -2,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12412           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  0, 2, 0, 0, 0, 0,   10,   0,    0,   0),
12413           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-3, 1, 0, 0, 0,    3,   0,    0,  -2),
12414           new PlanetaryNutModel(-2, 0, 2, 1, 0,  3, -3,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   3),
12415           new PlanetaryNutModel( 0, 0, 0, 1, 0,  8,-13,  0, 0, 0, 0, 0, 0,   46,  66,   35, -25),
12416           new PlanetaryNutModel( 0,-1, 1, 0, 0,  8,-12,  0, 0, 0, 0, 0, 0,  -14,   7,    0,   0),
12417           new PlanetaryNutModel( 0, 2,-2, 1, 0, -8, 11,  0, 0, 0, 0, 0, 0,    0,   3,    2,   0),
12418           new PlanetaryNutModel(-1, 0, 1, 0, 0,  0,  2, -2, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
12419           new PlanetaryNutModel(-1, 0, 0, 1, 0, 18,-16,  0, 0, 0, 0, 0, 0,  -68, -34,  -18,  36),
12420 
12421        /* 131-140 */
12422           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-1, 1, 0, 0, 0,    0,  14,    7,   0),
12423           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -7,  4, 0, 0, 0, 0, 0,   10,  -6,   -3,  -5),
12424           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0, -3,  7, 0, 0, 0, 0, 0,   -5,  -4,   -2,   3),
12425           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0,-2, 5, 0, 0, 0,   -3,   5,    2,   1),
12426           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0,-2, 5, 0, 0, 0,   76,  17,    9, -41),
12427           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -4,  8,-3, 0, 0, 0, 0,   84, 298,  159, -45),
12428           new PlanetaryNutModel( 1, 0, 0, 1, 0,-10,  3,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12429           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12430           new PlanetaryNutModel(-1, 0, 0, 1, 0, 10, -3,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12431           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  4, -8, 3, 0, 0, 0, 0,  -82, 292,  156,  44),
12432 
12433        /* 141-150 */
12434           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 2,-5, 0, 0, 0,  -73,  17,    9,  39),
12435           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 2,-5, 0, 0, 0,   -9, -16,    0,   0),
12436           new PlanetaryNutModel( 2,-1,-1, 1, 0,  0,  3, -7, 0, 0, 0, 0, 0,    3,   0,   -1,  -2),
12437           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0, 0,-5, 0, 0, 0,   -3,   0,    0,   0),
12438           new PlanetaryNutModel( 0, 0, 0, 1, 0, -3,  7, -4, 0, 0, 0, 0, 0,   -9,  -5,   -3,   5),
12439           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0, -439,   0,    0,   0),
12440           new PlanetaryNutModel( 1, 0, 0, 1, 0,-18, 16,  0, 0, 0, 0, 0, 0,   57, -28,  -15, -30),
12441           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0,  1,  0,-2, 0, 0, 0, 0,    0,  -6,   -3,   0),
12442           new PlanetaryNutModel( 0, 1,-1, 2, 0, -8, 12,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   2),
12443           new PlanetaryNutModel( 0, 0, 0, 1, 0, -8, 13,  0, 0, 0, 0, 0, 0,  -40,  57,   30,  21),
12444 
12445        /* 151-160 */
12446           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -2, 0, 0, 0, 0, 1,   23,   7,    3, -13),
12447           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  0, -2, 0, 0, 0, 0, 0,  273,  80,   43,-146),
12448           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -2, 0, 0, 0, 0, 0, -449, 430,    0,   0),
12449           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -2,  2, 0, 0, 0, 0, 0,   -8, -47,  -25,   4),
12450           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  2, 0, 0, 0, 0, 1,    6,  47,   25,  -3),
12451           new PlanetaryNutModel(-1, 0, 1, 1, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0,  23,   13,   0),
12452           new PlanetaryNutModel(-1, 0, 1, 1, 0,  0,  3, -4, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12453           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0,-2, 0, 0, 0,    3,  -4,   -2,  -2),
12454           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 2, 0, 0, 0,  -48,-110,  -59,  26),
12455           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 2, 0, 0, 1,   51, 114,   61, -27),
12456 
12457        /* 161-170 */
12458           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 2, 0, 0, 2, -133,   0,    0,  57),
12459           new PlanetaryNutModel( 0, 1,-1, 0, 0,  3, -6,  0, 0, 0, 0, 0, 0,    0,   4,    0,   0),
12460           new PlanetaryNutModel( 0, 0, 0, 1, 0, -3,  5,  0, 0, 0, 0, 0, 0,  -21,  -6,   -3,  11),
12461           new PlanetaryNutModel( 0, 1,-1, 2, 0, -3,  4,  0, 0, 0, 0, 0, 0,    0,  -3,   -1,   0),
12462           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -2,  4, 0, 0, 0, 0, 0,  -11, -21,  -11,   6),
12463           new PlanetaryNutModel( 0, 2,-2, 1, 0, -5,  6,  0, 0, 0, 0, 0, 0,  -18,-436, -233,   9),
12464           new PlanetaryNutModel( 0,-1, 1, 0, 0,  5, -7,  0, 0, 0, 0, 0, 0,   35,  -7,    0,   0),
12465           new PlanetaryNutModel( 0, 0, 0, 1, 0,  5, -8,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
12466           new PlanetaryNutModel(-2, 0, 2, 1, 0,  6, -8,  0, 0, 0, 0, 0, 0,   11,  -3,   -1,  -6),
12467           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -8, 15, 0, 0, 0, 0, 0,   -5,  -3,   -1,   3),
12468 
12469        /* 171-180 */
12470           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-3, 0, 0, 0, 0,  -53,  -9,   -5,  28),
12471           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  6, -8, 0, 0, 0, 0, 0,    0,   3,    2,   1),
12472           new PlanetaryNutModel( 1, 0,-1, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,    4,   0,    0,  -2),
12473           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3,-5, 0, 0, 0,    0,  -4,    0,   0),
12474           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-1, 0, 0, 0, 0,  -50, 194,  103,  27),
12475           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-1, 0, 0, 0, 1,  -13,  52,   28,   7),
12476           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 0,  -91, 248,    0,   0),
12477           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 1,    6,  49,   26,  -3),
12478           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,   -6, -47,  -25,   3),
12479           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 1,    0,   5,    3,   0),
12480 
12481        /* 181-190 */
12482           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 2,   52,  23,   10, -23),
12483           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 0,-1, 0, 0, 0,   -3,   0,    0,   1),
12484           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 0,-1, 0, 0, 0,    0,   5,    3,   0),
12485           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0,-1, 0, 0, 0,   -4,   0,    0,   0),
12486           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -7, 13, 0, 0, 0, 0, 2,   -4,   8,    3,   2),
12487           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7,-13, 0, 0, 0, 0, 0,   10,   0,    0,   0),
12488           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -5,  6, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12489           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -8, 11, 0, 0, 0, 0, 0,    0,   8,    4,   0),
12490           new PlanetaryNutModel( 0, 2,-2, 1,-1,  0,  2,  0, 0, 0, 0, 0, 0,    0,   8,    4,   1),
12491           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  4, -4, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
12492 
12493        /* 191-200 */
12494           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-2, 0, 0, 0,   -4,   0,    0,   0),
12495           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 3, 0, 0, 0,   -8,   4,    2,   4),
12496           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 3, 0, 0, 1,    8,  -4,   -2,  -4),
12497           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 3, 0, 0, 2,    0,  15,    7,   0),
12498           new PlanetaryNutModel(-2, 0, 2, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0, -138,   0,    0,   0),
12499           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,  -7,   -3,   0),
12500           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -7,   -3,   0),
12501           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -2,  0, 2, 0, 0, 0, 0,   54,   0,    0, -29),
12502           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 2, 0, 0, 0, 0,    0,  10,    4,   0),
12503           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0,  0, -2, 0, 0, 0, 0, 0,   -7,   0,    0,   3),
12504 
12505        /* 201-210 */
12506           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  1, -2, 0, 0, 0, 0, 0,  -37,  35,   19,  20),
12507           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  2, -2, 0, 0, 0, 0, 0,    0,   4,    0,   0),
12508           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0,-2, 0, 0, 0,   -4,   9,    0,   0),
12509           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 0, 2, 0, 0, 0,    8,   0,    0,  -4),
12510           new PlanetaryNutModel( 0, 1,-1, 1, 0,  3, -6,  0, 0, 0, 0, 0, 0,   -9, -14,   -8,   5),
12511           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  0, 0, 0, 0, 0, 1,   -3,  -9,   -5,   3),
12512           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  0, 0, 0, 0, 0, 0, -145,  47,    0,   0),
12513           new PlanetaryNutModel( 0, 1,-1, 1, 0, -3,  4,  0, 0, 0, 0, 0, 0,  -10,  40,   21,   5),
12514           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  5,  0, 0, 0, 0, 0, 1,   11, -49,  -26,  -7),
12515           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  5,  0, 0, 0, 0, 0, 2,-2150,   0,    0, 932),
12516 
12517        /* 211-220 */
12518           new PlanetaryNutModel( 0, 2,-2, 2, 0, -3,  3,  0, 0, 0, 0, 0, 0,  -12,   0,    0,   5),
12519           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  5,  0, 0, 0, 0, 0, 2,   85,   0,    0, -37),
12520           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -4, 0, 0, 0, 0, 1,    4,   0,    0,  -2),
12521           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  1, -4, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12522           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -4, 0, 0, 0, 0, 0,  -86, 153,    0,   0),
12523           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  4, 0, 0, 0, 0, 1,   -6,   9,    5,   3),
12524           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -3,  4, 0, 0, 0, 0, 0,    9, -13,   -7,  -5),
12525           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  4, 0, 0, 0, 0, 1,   -8,  12,    6,   4),
12526           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  4, 0, 0, 0, 0, 2,  -51,   0,    0,  22),
12527           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 2,  -11,-268, -116,   5),
12528 
12529        /* 221-230 */
12530           new PlanetaryNutModel( 0, 2,-2, 2, 0, -5,  6,  0, 0, 0, 0, 0, 0,    0,  12,    5,   0),
12531           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 2,    0,   7,    3,   0),
12532           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 1,   31,   6,    3, -17),
12533           new PlanetaryNutModel( 0, 1,-1, 1, 0, -5,  7,  0, 0, 0, 0, 0, 0,  140,  27,   14, -75),
12534           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 1,   57,  11,    6, -30),
12535           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -8,  0, 0, 0, 0, 0, 0,  -14, -39,    0,   0),
12536           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0,-1, 0, 0, 0, 0,    0,  -6,   -2,   0),
12537           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0,-1, 0, 0, 0, 0,    4,  15,    8,  -2),
12538           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    0,   4,    0,   0),
12539           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 1, 0, 0, 0, 0,   -3,   0,    0,   1),
12540 
12541        /* 231-240 */
12542           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 11, 0, 0, 0, 0, 2,    0,  11,    5,   0),
12543           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,-11, 0, 0, 0, 0, 0,    9,   6,    0,   0),
12544           new PlanetaryNutModel( 0, 0, 0, 0,-1,  0,  4,  0, 0, 0, 0, 0, 2,   -4,  10,    4,   2),
12545           new PlanetaryNutModel( 0, 0, 0, 0, 1,  0, -4,  0, 0, 0, 0, 0, 0,    5,   3,    0,   0),
12546           new PlanetaryNutModel( 2, 0,-2, 1, 0, -3,  3,  0, 0, 0, 0, 0, 0,   16,   0,    0,  -9),
12547           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0, 0,-2, 0, 0, 0,   -3,   0,    0,   0),
12548           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -7,  9, 0, 0, 0, 0, 0,    0,   3,    2,  -1),
12549           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 4,-5, 0, 0, 2,    7,   0,    0,  -3),
12550           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 0,  -25,  22,    0,   0),
12551           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 1,   42, 223,  119, -22),
12552 
12553        /* 241-250 */
12554           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 2, 0, 0, 0, 0,  -27,-143,  -77,  14),
12555           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 1,    9,  49,   26,  -5),
12556           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 2,-1166,   0,    0, 505),
12557           new PlanetaryNutModel( 0, 2,-2, 2, 0,  0, -2,  0, 2, 0, 0, 0, 0,   -5,   0,    0,   2),
12558           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 5, 0, 0, 2,   -6,   0,    0,   3),
12559           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -5,  0, 0, 0, 0, 0, 0,   -8,   0,    1,   4),
12560           new PlanetaryNutModel( 0,-1, 1, 0, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
12561           new PlanetaryNutModel( 0, 2,-2, 1, 0, -3,  3,  0, 0, 0, 0, 0, 0,  117,   0,    0, -63),
12562           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  2, -4, 0, 0, 0, 0, 0,   -4,   8,    4,   2),
12563           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -4,  4, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12564 
12565        /* 251-260 */
12566           new PlanetaryNutModel( 0, 1,-1, 2, 0, -5,  7,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   2),
12567           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -6, 0, 0, 0, 0, 0,    0,  31,    0,   0),
12568           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  6, 0, 0, 0, 0, 1,   -5,   0,    1,   3),
12569           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -4,  6, 0, 0, 0, 0, 0,    4,   0,    0,  -2),
12570           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  6, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12571           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  6, 0, 0, 0, 0, 2,  -24, -13,   -6,  10),
12572           new PlanetaryNutModel( 0,-1, 1, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    3,   0,    0,   0),
12573           new PlanetaryNutModel( 0, 0, 0, 1, 0,  2, -3,  0, 0, 0, 0, 0, 0,    0, -32,  -17,   0),
12574           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  9, 0, 0, 0, 0, 2,    8,  12,    5,  -3),
12575           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  9, 0, 0, 0, 0, 1,    3,   0,    0,  -1),
12576 
12577        /* 261-270 */
12578           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -9, 0, 0, 0, 0, 0,    7,  13,    0,   0),
12579           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0,-2, 0, 0, 0, 0,   -3,  16,    0,   0),
12580           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 2, 0, 0, 0, 0,   50,   0,    0, -27),
12581           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -5,   -3,   0),
12582           new PlanetaryNutModel( 0,-2, 2, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,   13,   0,    0,   0),
12583           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6, 10,  0, 0, 0, 0, 0, 1,    0,   5,    3,   1),
12584           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6, 10,  0, 0, 0, 0, 0, 2,   24,   5,    2, -11),
12585           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  3,  0, 0, 0, 0, 0, 2,    5, -11,   -5,  -2),
12586           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  3,  0, 0, 0, 0, 0, 1,   30,  -3,   -2, -16),
12587           new PlanetaryNutModel( 0, 1,-1, 1, 0, -2,  2,  0, 0, 0, 0, 0, 0,   18,   0,    0,  -9),
12588 
12589        /* 271-280 */
12590           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -3,  0, 0, 0, 0, 0, 0,    8, 614,    0,   0),
12591           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -3,  0, 0, 0, 0, 0, 1,    3,  -3,   -1,  -2),
12592           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3, 0, 0, 0, 1,    6,  17,    9,  -3),
12593           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 3, 0, 0, 0, 0,   -3,  -9,   -5,   2),
12594           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3, 0, 0, 0, 1,    0,   6,    3,  -1),
12595           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3, 0, 0, 0, 2, -127,  21,    9,  55),
12596           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 0, 0, 0, 0, 0,    3,   5,    0,   0),
12597           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  8, 0, 0, 0, 0, 2,   -6, -10,   -4,   3),
12598           new PlanetaryNutModel( 0,-2, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,    5,   0,    0,   0),
12599           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  7, 0, 0, 0, 0, 2,   16,   9,    4,  -7),
12600 
12601        /* 281-290 */
12602           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  7, 0, 0, 0, 0, 1,    3,   0,    0,  -2),
12603           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -7, 0, 0, 0, 0, 0,    0,  22,    0,   0),
12604           new PlanetaryNutModel( 0, 0, 0, 1, 0, -2,  3,  0, 0, 0, 0, 0, 0,    0,  19,   10,   0),
12605           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 3, 0, 0, 0, 0,    7,   0,    0,  -4),
12606           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5, 10, 0, 0, 0, 0, 2,    0,  -5,   -2,   0),
12607           new PlanetaryNutModel( 0, 0, 0, 1, 0, -1,  2,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12608           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 4, 0, 0, 0, 2,   -9,   3,    1,   4),
12609           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  5, 0, 0, 0, 0, 2,   17,   0,    0,  -7),
12610           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  5, 0, 0, 0, 0, 1,    0,  -3,   -2,  -1),
12611           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -5, 0, 0, 0, 0, 0,  -20,  34,    0,   0),
12612 
12613        /* 291-300 */
12614           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -2,  0, 0, 0, 0, 0, 1,  -10,   0,    1,   5),
12615           new PlanetaryNutModel( 0, 1,-1, 1, 0,  1, -3,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   2),
12616           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -2,  0, 0, 0, 0, 0, 0,   22, -87,    0,   0),
12617           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  2,  0, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12618           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  2,  0, 0, 0, 0, 0, 2,   -3,  -6,   -2,   1),
12619           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 11,  0, 0, 0, 0, 0, 2,  -16,  -3,   -1,   7),
12620           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 11,  0, 0, 0, 0, 0, 1,    0,  -3,   -2,   0),
12621           new PlanetaryNutModel( 0,-2, 2, 0, 0,  4, -4,  0, 0, 0, 0, 0, 0,    4,   0,    0,   0),
12622           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -3, 0, 0, 0, 0, 0,  -68,  39,    0,   0),
12623           new PlanetaryNutModel( 0, 2,-2, 1, 0, -4,  4,  0, 0, 0, 0, 0, 0,   27,   0,    0, -14),
12624 
12625        /* 301-310 */
12626           new PlanetaryNutModel( 0,-1, 1, 0, 0,  4, -5,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
12627           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -1, 0, 0, 0, 0, 0,  -25,   0,    0,   0),
12628           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  7,  0, 0, 0, 0, 0, 1,  -12,  -3,   -2,   6),
12629           new PlanetaryNutModel( 0, 1,-1, 1, 0, -4,  6,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12630           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  7,  0, 0, 0, 0, 0, 2,    3,  66,   29,  -1),
12631           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  6,  0, 0, 0, 0, 0, 2,  490,   0,    0,-213),
12632           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  6,  0, 0, 0, 0, 0, 1,  -22,  93,   49,  12),
12633           new PlanetaryNutModel( 0, 1,-1, 1, 0, -4,  5,  0, 0, 0, 0, 0, 0,   -7,  28,   15,   4),
12634           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  6,  0, 0, 0, 0, 0, 1,   -3,  13,    7,   2),
12635           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -6,  0, 0, 0, 0, 0, 0,  -46,  14,    0,   0),
12636 
12637        /* 311-320 */
12638           new PlanetaryNutModel(-2, 0, 2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
12639           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  1, 0, 0, 0, 0, 0,    2,   1,    0,   0),
12640           new PlanetaryNutModel( 0,-1, 1, 0, 0,  1,  0,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12641           new PlanetaryNutModel( 0, 0, 0, 1, 0,  1, -1,  0, 0, 0, 0, 0, 0,  -28,   0,    0,  15),
12642           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 5, 0, 0, 0, 2,    5,   0,    0,  -2),
12643           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -3, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12644           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  3, 0, 0, 0, 0, 2,  -11,   0,    0,   5),
12645           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -7, 12, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12646           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  1,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12647           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  1,  0, 0, 0, 0, 0, 1,   25, 106,   57, -13),
12648 
12649        /* 321-330 */
12650           new PlanetaryNutModel( 0, 1,-1, 1, 0, -1,  0,  0, 0, 0, 0, 0, 0,    5,  21,   11,  -3),
12651           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0, 1485,   0,    0,   0),
12652           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 1,   -7, -32,  -17,   4),
12653           new PlanetaryNutModel( 0, 1,-1, 1, 0,  1, -2,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
12654           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  5, 0, 0, 0, 0, 2,   -6,  -3,   -2,   3),
12655           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 4, 0, 0, 0, 2,   30,  -6,   -2, -13),
12656           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-4, 0, 0, 0, 0,   -4,   4,    0,   0),
12657           new PlanetaryNutModel( 0, 0, 0, 1, 0, -1,  1,  0, 0, 0, 0, 0, 0,  -19,   0,    0,  10),
12658           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 10, 0, 0, 0, 0, 2,    0,   4,    2,  -1),
12659           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 10, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12660 
12661        /* 331-340 */
12662           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -3,  0, 3, 0, 0, 0, 0,    4,   0,    0,  -2),
12663           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  7, 0, 0, 0, 0, 2,    0,  -3,   -1,   0),
12664           new PlanetaryNutModel(-2, 0, 2, 0, 0,  4, -4,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12665           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  8, 0, 0, 0, 0, 2,    5,   3,    1,  -2),
12666           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -8, 0, 0, 0, 0, 0,    0,  11,    0,   0),
12667           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 3, 0, 0, 0, 2,  118,   0,    0, -52),
12668           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 3, 0, 0, 0, 1,    0,  -5,   -3,   0),
12669           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-3, 0, 0, 0, 0,  -28,  36,    0,   0),
12670           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -4,  0, 0, 0, 0, 0, 0,    5,  -5,    0,   0),
12671           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  4,  0, 0, 0, 0, 0, 1,   14, -59,  -31,  -8),
12672 
12673        /* 341-350 */
12674           new PlanetaryNutModel( 0, 1,-1, 1, 0, -2,  3,  0, 0, 0, 0, 0, 0,    0,   9,    5,   1),
12675           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  4,  0, 0, 0, 0, 0, 2, -458,   0,    0, 198),
12676           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  9,  0, 0, 0, 0, 0, 2,    0, -45,  -20,   0),
12677           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  9,  0, 0, 0, 0, 0, 1,    9,   0,    0,  -5),
12678           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -9,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12679           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  1,  0,-2, 0, 0, 0, 0,    0,  -4,   -2,  -1),
12680           new PlanetaryNutModel( 0, 2,-2, 1, 0, -2,  2,  0, 0, 0, 0, 0, 0,   11,   0,    0,  -6),
12681           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  6, 0, 0, 0, 0, 2,    6,   0,    0,  -2),
12682           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -6, 0, 0, 0, 0, 0,  -16,  23,    0,   0),
12683           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0,  -4,   -2,   0),
12684 
12685        /* 351-360 */
12686           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 2, 0, 0, 0, 2,   -5,   0,    0,   2),
12687           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-2, 0, 0, 0, 0, -166, 269,    0,   0),
12688           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  1,  0,-1, 0, 0, 0, 0,   15,   0,    0,  -8),
12689           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  9,  0, 0, 0, 0, 0, 2,   10,   0,    0,  -4),
12690           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -4, 0, 0, 0, 0, 0,  -78,  45,    0,   0),
12691           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  4,  0, 0, 0, 0, 0, 2,    0,  -5,   -2,   0),
12692           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  4,  0, 0, 0, 0, 0, 1,    7,   0,    0,  -4),
12693           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -4,  0, 0, 0, 0, 0, 0,   -5, 328,    0,   0),
12694           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -4,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -2),
12695           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  2, -2, 0, 0, 0, 0, 0,    5,   0,    0,  -2),
12696 
12697        /* 361-370 */
12698           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -1,  0, 2, 0, 0, 0, 0,    0,   3,    1,   0),
12699           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0,-3, 0, 0, 0,   -3,   0,    0,   0),
12700           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1,-5, 0, 0, 0,   -3,   0,    0,   0),
12701           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 1, 0, 0, 0, 1,    0,  -4,   -2,   0),
12702           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,-1223, -26,    0,   0),
12703           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 1,    0,   7,    3,   0),
12704           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-3, 5, 0, 0, 0,    3,   0,    0,   0),
12705           new PlanetaryNutModel( 0, 0, 0, 1, 0, -3,  4,  0, 0, 0, 0, 0, 0,    0,   3,    2,   0),
12706           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0,-2, 0, 0, 0,   -6,  20,    0,   0),
12707           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -2, 0, 0, 0, 0, 0, -368,   0,    0,   0),
12708 
12709        /* 371-380 */
12710           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0,-1, 0, 0, 0,  -75,   0,    0,   0),
12711           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,   11,   0,    0,  -6),
12712           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -2,  2, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12713           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 14,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12714           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 2,-5, 0, 0, 0,  -13, -30,    0,   0),
12715           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -8, 3, 0, 0, 0, 0,   21,   3,    0,   0),
12716           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -8, 3, 0, 0, 0, 2,   -3,   0,    0,   1),
12717           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12718           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    8, -27,    0,   0),
12719           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -8, 3, 0, 0, 0, 0,  -19, -11,    0,   0),
12720 
12721        /* 381-390 */
12722           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  8,-3, 0, 0, 0, 2,   -4,   0,    0,   2),
12723           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-2, 5, 0, 0, 2,    0,   5,    2,   0),
12724           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 12,  0, 0, 0, 0, 0, 2,   -6,   0,    0,   2),
12725           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 12,  0, 0, 0, 0, 0, 0,   -8,   0,    0,   0),
12726           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1,-2, 0, 0, 0,   -1,   0,    0,   0),
12727           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0, 1, 0, 0, 2,  -14,   0,    0,   6),
12728           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  2, 0, 0, 0, 0, 0,    6,   0,    0,   0),
12729           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  2, 0, 0, 0, 0, 2,  -74,   0,    0,  32),
12730           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0, 2, 0, 0, 2,    0,  -3,   -1,   0),
12731           new PlanetaryNutModel( 0, 2,-2, 1, 0, -5,  5,  0, 0, 0, 0, 0, 0,    4,   0,    0,  -2),
12732 
12733        /* 391-400 */
12734           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1, 0, 0, 0, 0,    8,  11,    0,   0),
12735           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1, 0, 0, 0, 1,    0,   3,    2,   0),
12736           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1, 0, 0, 0, 2, -262,   0,    0, 114),
12737           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -6,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
12738           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  6,  0, 0, 0, 0, 0, 1,   -7,   0,    0,   4),
12739           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  6,  0, 0, 0, 0, 0, 2,    0, -27,  -12,   0),
12740           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  4, 0, 0, 0, 0, 2,  -19,  -8,   -4,   8),
12741           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  7,  0, 0, 0, 0, 0, 2,  202,   0,    0, -87),
12742           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  7,  0, 0, 0, 0, 0, 1,   -8,  35,   19,   5),
12743           new PlanetaryNutModel( 0, 1,-1, 1, 0, -5,  6,  0, 0, 0, 0, 0, 0,    0,   4,    2,   0),
12744 
12745        /* 401-410 */
12746           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -7,  0, 0, 0, 0, 0, 0,   16,  -5,    0,   0),
12747           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,    5,   0,    0,  -3),
12748           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 1, 0, 0, 0, 0,    0,  -3,    0,   0),
12749           new PlanetaryNutModel( 0, 0, 0, 0,-1,  0,  3,  0, 0, 0, 0, 0, 2,    1,   0,    0,   0),
12750           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 2, 0, 0, 0, 2,  -35, -48,  -21,  15),
12751           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  6, 0, 0, 0, 0, 2,   -3,  -5,   -2,   1),
12752           new PlanetaryNutModel( 0, 0, 0, 1, 0,  2, -2,  0, 0, 0, 0, 0, 0,    6,   0,    0,  -3),
12753           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6,  9, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
12754           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -9, 0, 0, 0, 0, 0,    0,  -5,    0,   0),
12755           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  2,  0, 0, 0, 0, 0, 1,   12,  55,   29,  -6),
12756 
12757        /* 411-420 */
12758           new PlanetaryNutModel( 0, 1,-1, 1, 0, -2,  1,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
12759           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0, -598,   0,    0,   0),
12760           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -2,  0, 0, 0, 0, 0, 1,   -3, -13,   -7,   1),
12761           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 3, 0, 0, 0, 2,   -5,  -7,   -3,   2),
12762           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  7, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
12763           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -7, 0, 0, 0, 0, 0,    5,  -7,    0,   0),
12764           new PlanetaryNutModel( 0, 0, 0, 1, 0, -2,  2,  0, 0, 0, 0, 0, 0,    4,   0,    0,  -2),
12765           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -5, 0, 0, 0, 0, 0,   16,  -6,    0,   0),
12766           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -3,  0, 0, 0, 0, 0, 0,    8,  -3,    0,   0),
12767           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  3,  0, 0, 0, 0, 0, 1,    8, -31,  -16,  -4),
12768 
12769        /* 421-430 */
12770           new PlanetaryNutModel( 0, 1,-1, 1, 0, -1,  2,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12771           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  3,  0, 0, 0, 0, 0, 2,  113,   0,    0, -49),
12772           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 10,  0, 0, 0, 0, 0, 2,    0, -24,  -10,   0),
12773           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 10,  0, 0, 0, 0, 0, 1,    4,   0,    0,  -2),
12774           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -3, 0, 0, 0, 0, 0,   27,   0,    0,   0),
12775           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  8,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12776           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  5,  0, 0, 0, 0, 0, 2,    0,  -4,   -2,   0),
12777           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  5,  0, 0, 0, 0, 0, 1,    5,   0,    0,  -2),
12778           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -5,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12779           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  1, 0, 0, 0, 0, 2,  -13,   0,    0,   6),
12780 
12781        /* 431-440 */
12782           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  0, 5, 0, 0, 0, 2,    5,   0,    0,  -2),
12783           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  3, 0, 0, 0, 0, 2,  -18, -10,   -4,   8),
12784           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  0,  0, 0, 0, 0, 0, 0,   -4, -28,    0,   0),
12785           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  0,  0, 0, 0, 0, 0, 2,   -5,   6,    3,   2),
12786           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 13,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12787           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  5, 0, 0, 0, 0, 2,   -5,  -9,   -4,   2),
12788           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  0, 4, 0, 0, 0, 2,   17,   0,    0,  -7),
12789           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-4, 0, 0, 0, 0,   11,   4,    0,   0),
12790           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  7, 0, 0, 0, 0, 2,    0,  -6,   -2,   0),
12791           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   83,  15,    0,   0),
12792 
12793        /* 441-450 */
12794           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  5,  0, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12795           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  5,  0, 0, 0, 0, 0, 2,    0,-114,  -49,   0),
12796           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  8,  0, 0, 0, 0, 0, 2,  117,   0,    0, -51),
12797           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  8,  0, 0, 0, 0, 0, 1,   -5,  19,   10,   2),
12798           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -8,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12799           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   2),
12800           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  9, 0, 0, 0, 0, 2,    0,  -3,   -1,   0),
12801           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -6, 0, 0, 0, 0, 0,    3,   0,    0,   0),
12802           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -6, 0, 0, 0, 0, 2,    0,  -6,   -2,   0),
12803           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,  393,   3,    0,   0),
12804 
12805        /* 451-460 */
12806           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 1,   -4,  21,   11,   2),
12807           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 2,   -6,   0,   -1,   3),
12808           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5, 10,  0, 0, 0, 0, 0, 2,   -3,   8,    4,   1),
12809           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -4, 0, 0, 0, 0, 0,    8,   0,    0,   0),
12810           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -4, 0, 0, 0, 0, 2,   18, -29,  -13,  -8),
12811           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  3,  0, 0, 0, 0, 0, 1,    8,  34,   18,  -4),
12812           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,   89,   0,    0,   0),
12813           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 1,    3,  12,    6,  -1),
12814           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 2,   54, -15,   -7, -24),
12815           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-3, 0, 0, 0,    0,   3,    0,   0),
12816 
12817        /* 461-470 */
12818           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5, 13, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
12819           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-1, 0, 0, 0, 0,    0,  35,    0,   0),
12820           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-1, 0, 0, 0, 2, -154, -30,  -13,  67),
12821           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-2, 0, 0, 0,   15,   0,    0,   0),
12822           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-2, 0, 0, 1,    0,   4,    2,   0),
12823           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -2, 0, 0, 0, 0, 0,    0,   9,    0,   0),
12824           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -2, 0, 0, 0, 0, 2,   80, -71,  -31, -35),
12825           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-1, 0, 0, 2,    0, -20,   -9,   0),
12826           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 15, 0, 0, 0, 0, 2,   11,   5,    2,  -5),
12827           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 15,  0, 0, 0, 0, 0, 2,   61, -96,  -42, -27),
12828 
12829        /* 471-480 */
12830           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  9, -4, 0, 0, 0, 0, 2,   14,   9,    4,  -6),
12831           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 2,-5, 0, 0, 2,  -11,  -6,   -3,   5),
12832           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  8,-1,-5, 0, 0, 2,    0,  -3,   -1,   0),
12833           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -8, 3, 0, 0, 0, 2,  123,-415, -180, -53),
12834           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 0,    0,   0,    0, -35),
12835           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
12836           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 1,    7, -32,  -17,  -4),
12837           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -9,   -5,   0),
12838           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 1,    0,  -4,    2,   0),
12839           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 2,  -89,   0,    0,  38),
12840 
12841        /* 481-490 */
12842           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 16,-4,-5, 0, 0, 2,    0, -86,  -19,  -6),
12843           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  8,-3, 0, 0, 0, 2,    0,   0,  -19,   6),
12844           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  8,-3, 0, 0, 0, 2, -123,-416, -180,  53),
12845           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -8, 1, 5, 0, 0, 2,    0,  -3,   -1,   0),
12846           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 5, 0, 0, 2,   12,  -6,   -3,  -5),
12847           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  4, 0, 0, 0, 0, 2,  -13,   9,    4,   6),
12848           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 11,  0, 0, 0, 0, 0, 2,    0, -15,   -7,   0),
12849           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 11,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -1),
12850           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 11,  0, 0, 0, 0, 0, 2,  -62, -97,  -42,  27),
12851           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, 11,  0, 0, 0, 0, 0, 2,  -11,   5,    2,   5),
12852 
12853        /* 491-500 */
12854           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 1, 0, 0, 2,    0, -19,   -8,   0),
12855           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 2, 0, 0, 0, 2,   -3,   0,    0,   1),
12856           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,   4,    2,   0),
12857           new PlanetaryNutModel( 0, 1,-1, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12858           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,   4,    2,   0),
12859           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  2, 0, 0, 0, 0, 2,  -85, -70,  -31,  37),
12860           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 1, 0, 0, 0, 2,  163, -12,   -5, -72),
12861           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  7,  0, 0, 0, 0, 0, 2,  -63, -16,   -7,  28),
12862           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  4, 0, 0, 0, 0, 2,  -21, -32,  -14,   9),
12863           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  6,  0, 0, 0, 0, 0, 2,    0,  -3,   -1,   0),
12864 
12865        /* 501-510 */
12866           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  6,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -2),
12867           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -6,  0, 0, 0, 0, 0, 0,    0,   8,    0,   0),
12868           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -6,  0, 0, 0, 0, 0, 2,    3,  10,    4,  -1),
12869           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 2, 0, 0, 0, 2,    3,   0,    0,  -1),
12870           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  6, 0, 0, 0, 0, 2,    0,  -7,   -3,   0),
12871           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -9, 0, 0, 0, 0, 2,    0,  -4,   -2,   0),
12872           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -1,  0, 0, 0, 0, 0, 0,    6,  19,    0,   0),
12873           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -1,  0, 0, 0, 0, 0, 2,    5,-173,  -75,  -2),
12874           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -7, 0, 0, 0, 0, 2,    0,  -7,   -3,   0),
12875           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -5, 0, 0, 0, 0, 2,    7, -12,   -5,  -3),
12876 
12877        /* 511-520 */
12878           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  4,  0, 0, 0, 0, 0, 1,   -3,   0,    0,   2),
12879           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  4,  0, 0, 0, 0, 0, 2,    3,  -4,   -2,  -1),
12880           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7,  9,  0, 0, 0, 0, 0, 2,   74,   0,    0, -32),
12881           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7,  9,  0, 0, 0, 0, 0, 1,   -3,  12,    6,   2),
12882           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -3, 0, 0, 0, 0, 2,   26, -14,   -6, -11),
12883           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -1, 0, 0, 0, 0, 2,   19,   0,    0,  -8),
12884           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  4,  0, 0, 0, 0, 0, 1,    6,  24,   13,  -3),
12885           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -4,  0, 0, 0, 0, 0, 0,   83,   0,    0,   0),
12886           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -4,  0, 0, 0, 0, 0, 1,    0, -10,   -5,   0),
12887           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -4,  0, 0, 0, 0, 0, 2,   11,  -3,   -1,  -5),
12888 
12889        /* 521-530 */
12890           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  1, 0, 0, 0, 0, 2,    3,   0,    1,  -1),
12891           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  0, 5, 0, 0, 0, 2,    3,   0,    0,  -1),
12892           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  1,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
12893           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  1,  0, 0, 0, 0, 0, 1,    5, -23,  -12,  -3),
12894           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  1,  0, 0, 0, 0, 0, 2, -339,   0,    0, 147),
12895           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 12,  0, 0, 0, 0, 0, 2,    0, -10,   -5,   0),
12896           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-4, 0, 0, 0, 0,    5,   0,    0,   0),
12897           new PlanetaryNutModel( 0, 2,-2, 1, 0,  1, -1,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12898           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -8, 0, 0, 0, 0, 2,    0,  -4,   -2,   0),
12899           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-3, 0, 0, 0, 0,   18,  -3,    0,   0),
12900 
12901        /* 531-540 */
12902           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-3, 0, 0, 0, 2,    9, -11,   -5,  -4),
12903           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  6,  0, 0, 0, 0, 0, 2,   -8,   0,    0,   4),
12904           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  7,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -1),
12905           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -7,  0, 0, 0, 0, 0, 0,    0,   9,    0,   0),
12906           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -6, 0, 0, 0, 0, 2,    6,  -9,   -4,  -2),
12907           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-2, 0, 0, 0, 0,   -4, -12,    0,   0),
12908           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-2, 0, 0, 0, 2,   67, -91,  -39, -29),
12909           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -4, 0, 0, 0, 0, 2,   30, -18,   -8, -13),
12910           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -2,  0, 0, 0, 0, 0, 0,    0,   0,    0,   0),
12911           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -2,  0, 0, 0, 0, 0, 2,    0,-114,  -50,   0),
12912 
12913        /* 541-550 */
12914           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-1, 0, 0, 0, 2,    0,   0,    0,  23),
12915           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-1, 0, 0, 0, 2,  517,  16,    7,-224),
12916           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 0,-2, 0, 0, 2,    0,  -7,   -3,   0),
12917           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -2, 0, 0, 0, 0, 2,  143,  -3,   -1, -62),
12918           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 0,-1, 0, 0, 2,   29,   0,    0, -13),
12919           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0,  1,  0,-1, 0, 0, 0, 0,   -4,   0,    0,   2),
12920           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 16,  0, 0, 0, 0, 0, 2,   -6,   0,    0,   3),
12921           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 2,-5, 0, 0, 2,    5,  12,    5,  -2),
12922           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -8, 3, 0, 0, 0, 2,  -25,   0,    0,  11),
12923           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5, 16,-4,-5, 0, 0, 2,   -3,   0,    0,   1),
12924 
12925        /* 551-560 */
12926           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 0, 0, 0, 0, 2,    0,   4,    2,   0),
12927           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  8,-3, 0, 0, 0, 2,  -22,  12,    5,  10),
12928           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 10,  0, 0, 0, 0, 0, 2,   50,   0,    0, -22),
12929           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 10,  0, 0, 0, 0, 0, 1,    0,   7,    4,   0),
12930           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 10,  0, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12931           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  2, 0, 0, 0, 0, 2,   -4,   4,    2,   2),
12932           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 1, 0, 0, 0, 2,   -5, -11,   -5,   2),
12933           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  8,  0, 0, 0, 0, 0, 2,    0,   4,    2,   0),
12934           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  5,  0, 0, 0, 0, 0, 1,    4,  17,    9,  -2),
12935           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -5,  0, 0, 0, 0, 0, 0,   59,   0,    0,   0),
12936 
12937        /* 561-570 */
12938           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -5,  0, 0, 0, 0, 0, 1,    0,  -4,   -2,   0),
12939           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -5,  0, 0, 0, 0, 0, 2,   -8,   0,    0,   4),
12940           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  0,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12941           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  0,  0, 0, 0, 0, 0, 1,    4, -15,   -8,  -2),
12942           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  0,  0, 0, 0, 0, 0, 2,  370,  -8,    0,-160),
12943           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -7, 0, 0, 0, 0, 2,    0,   0,   -3,   0),
12944           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -7, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12945           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -5, 0, 0, 0, 0, 2,   -6,   3,    1,   3),
12946           new PlanetaryNutModel( 0, 0, 0, 0, 0,  7, -8,  0, 0, 0, 0, 0, 0,    0,   6,    0,   0),
12947           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -3, 0, 0, 0, 0, 2,  -10,   0,    0,   4),
12948 
12949        /* 571-580 */
12950           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -3,  0, 0, 0, 0, 0, 2,    0,   9,    4,   0),
12951           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  2,  0, 0, 0, 0, 0, 2,    4,  17,    7,  -2),
12952           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 11,  0, 0, 0, 0, 0, 2,   34,   0,    0, -15),
12953           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 11,  0, 0, 0, 0, 0, 1,    0,   5,    3,   0),
12954           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-4, 0, 0, 0, 2,   -5,   0,    0,   2),
12955           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-3, 0, 0, 0, 2,  -37,  -7,   -3,  16),
12956           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  6,  0, 0, 0, 0, 0, 1,    3,  13,    7,  -2),
12957           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -6,  0, 0, 0, 0, 0, 0,   40,   0,    0,   0),
12958           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -6,  0, 0, 0, 0, 0, 1,    0,  -3,   -2,   0),
12959           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-2, 0, 0, 0, 2, -184,  -3,   -1,  80),
12960 
12961        /* 581-590 */
12962           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -4, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12963           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -1,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12964           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -1,  0, 0, 0, 0, 0, 1,    0, -10,   -6,  -1),
12965           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -1,  0, 0, 0, 0, 0, 2,   31,  -6,    0, -13),
12966           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-1, 0, 0, 0, 2,   -3, -32,  -14,   1),
12967           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0, 0,-2, 0, 0, 2,   -7,   0,    0,   3),
12968           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -2, 0, 0, 0, 0, 2,    0,  -8,   -4,   0),
12969           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0, 0, 0, 0, 0, 0,    3,  -4,    0,   0),
12970           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8, -9,  0, 0, 0, 0, 0, 0,    0,   4,    0,   0),
12971           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -4,  0, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12972 
12973        /* 591-600 */
12974           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  1,  0, 0, 0, 0, 0, 2,   19, -23,  -10,   2),
12975           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  1,  0, 0, 0, 0, 0, 1,    0,   0,    0, -10),
12976           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  1,  0, 0, 0, 0, 0, 1,    0,   3,    2,   0),
12977           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7,  7,  0, 0, 0, 0, 0, 1,    0,   9,    5,  -1),
12978           new PlanetaryNutModel( 0, 0, 0, 0, 0,  7, -7,  0, 0, 0, 0, 0, 0,   28,   0,    0,   0),
12979           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 1,    0,  -7,   -4,   0),
12980           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 2,    8,  -4,    0,  -4),
12981           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 0,    0,   0,   -2,   0),
12982           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12983           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5,  0,-4, 0, 0, 0, 2,   -3,   0,    0,   1),
12984 
12985        /* 601-610 */
12986           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5,  0,-3, 0, 0, 0, 2,   -9,   0,    1,   4),
12987           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5,  0,-2, 0, 0, 0, 2,    3,  12,    5,  -1),
12988           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3,  0,  0, 0, 0, 0, 0, 2,   17,  -3,   -1,   0),
12989           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8,  8,  0, 0, 0, 0, 0, 1,    0,   7,    4,   0),
12990           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8, -8,  0, 0, 0, 0, 0, 0,   19,   0,    0,   0),
12991           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -3,  0, 0, 0, 0, 0, 1,    0,  -5,   -3,   0),
12992           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -3,  0, 0, 0, 0, 0, 2,   14,  -3,    0,  -1),
12993           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9,  9,  0, 0, 0, 0, 0, 1,    0,   0,   -1,   0),
12994           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9,  9,  0, 0, 0, 0, 0, 1,    0,   0,    0,  -5),
12995           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9,  9,  0, 0, 0, 0, 0, 1,    0,   5,    3,   0),
12996 
12997        /* 611-620 */
12998           new PlanetaryNutModel( 0, 0, 0, 0, 0,  9, -9,  0, 0, 0, 0, 0, 0,   13,   0,    0,   0),
12999           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -4,  0, 0, 0, 0, 0, 1,    0,  -3,   -2,   0),
13000           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 2,    2,   9,    4,   3),
13001           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 0,    0,   0,    0,  -4),
13002           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 0,    8,   0,    0,   0),
13003           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 1,    0,   4,    2,   0),
13004           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 2,    6,   0,    0,  -3),
13005           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 0,    6,   0,    0,   0),
13006           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 1,    0,   3,    1,   0),
13007           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 2,    5,   0,    0,  -2),
13008 
13009        /* 621-630 */
13010           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
13011           new PlanetaryNutModel( 1, 0,-2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   0),
13012           new PlanetaryNutModel( 1, 0,-2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    6,   0,    0,   0),
13013           new PlanetaryNutModel( 1, 0,-2, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    7,   0,    0,   0),
13014           new PlanetaryNutModel( 1, 0,-2, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
13015           new PlanetaryNutModel(-1, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,    4,   0,    0,   0),
13016           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,    6,   0,    0,   0),
13017           new PlanetaryNutModel(-1, 0, 2, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -4,    0,   0),
13018           new PlanetaryNutModel( 1, 0,-2, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -4,    0,   0),
13019           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    5,   0,    0,   0),
13020 
13021        /* 631-640 */
13022           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   -3,   0,    0,   0),
13023           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    4,   0,    0,   0),
13024           new PlanetaryNutModel(-1, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
13025           new PlanetaryNutModel(-1, 0, 2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    4,   0,    0,   0),
13026           new PlanetaryNutModel( 1,-1, 1, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,   3,    0,   0),
13027           new PlanetaryNutModel(-1, 0, 2, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   13,   0,    0,   0),
13028           new PlanetaryNutModel(-2, 0, 0, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   21,  11,    0,   0),
13029           new PlanetaryNutModel( 1, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -5,    0,   0),
13030           new PlanetaryNutModel(-1, 1,-1, 1, 0,  0, -1,  0, 0, 0, 0, 0, 0,    0,  -5,   -2,   0),
13031           new PlanetaryNutModel( 1, 1,-1, 1, 0,  0, -1,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
13032 
13033        /* 641-650 */
13034           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -5,    0,   0),
13035           new PlanetaryNutModel(-1, 0, 2, 1, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   2),
13036           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,   20,  10,    0,   0),
13037           new PlanetaryNutModel(-1, 0, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,  -34,   0,    0,   0),
13038           new PlanetaryNutModel(-1, 0, 2, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,  -19,   0,    0,   0),
13039           new PlanetaryNutModel( 1, 0,-2, 1, 0,  0, -2,  0, 2, 0, 0, 0, 0,    3,   0,    0,  -2),
13040           new PlanetaryNutModel( 1, 2,-2, 2, 0, -3,  3,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
13041           new PlanetaryNutModel( 1, 2,-2, 2, 0,  0, -2,  0, 2, 0, 0, 0, 0,   -6,   0,    0,   3),
13042           new PlanetaryNutModel( 1, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
13043           new PlanetaryNutModel( 1, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    3,   0,    0,   0),
13044 
13045        /* 651-660 */
13046           new PlanetaryNutModel( 0, 0,-2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    3,   0,    0,   0),
13047           new PlanetaryNutModel( 0, 0,-2, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    4,   0,    0,   0),
13048           new PlanetaryNutModel( 0, 2, 0, 2, 0, -2,  2,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
13049           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0, -1,  0, 1, 0, 0, 0, 0,    6,   0,    0,  -3),
13050           new PlanetaryNutModel( 0, 2, 0, 2, 0, -1,  1,  0, 0, 0, 0, 0, 0,   -8,   0,    0,   3),
13051           new PlanetaryNutModel( 0, 2, 0, 2, 0, -2,  3,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
13052           new PlanetaryNutModel( 0, 0, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   0),
13053           new PlanetaryNutModel( 0, 1, 1, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -3,   -2,   0),
13054           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,  126, -63,  -27, -55),
13055           new PlanetaryNutModel(-1, 2, 0, 2, 0, 10, -3,  0, 0, 0, 0, 0, 0,   -5,   0,    1,   2),
13056 
13057        /* 661-670 */
13058           new PlanetaryNutModel( 0, 1, 1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,   -3,  28,   15,   2),
13059           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,    5,   0,    1,  -2),
13060           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,   9,    4,   1),
13061           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,   9,    4,  -1),
13062           new PlanetaryNutModel(-1, 2, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0, -126, -63,  -27,  55),
13063           new PlanetaryNutModel( 2, 2,-2, 2, 0,  0, -2,  0, 3, 0, 0, 0, 0,    3,   0,    0,  -1),
13064           new PlanetaryNutModel( 1, 2, 0, 1, 0,  0, -2,  0, 3, 0, 0, 0, 0,   21, -11,   -6, -11),
13065           new PlanetaryNutModel( 0, 1, 1, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
13066           new PlanetaryNutModel(-1, 2, 0, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,  -21, -11,   -6,  11),
13067           new PlanetaryNutModel(-2, 2, 2, 2, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   1),
13068 
13069        /* 671-680 */
13070           new PlanetaryNutModel( 0, 2, 0, 2, 0,  2, -3,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
13071           new PlanetaryNutModel( 0, 2, 0, 2, 0,  1, -1,  0, 0, 0, 0, 0, 0,    8,   0,    0,  -4),
13072           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0,  1,  0,-1, 0, 0, 0, 0,   -6,   0,    0,   3),
13073           new PlanetaryNutModel( 0, 2, 0, 2, 0,  2, -2,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
13074           new PlanetaryNutModel(-1, 2, 2, 2, 0,  0, -1,  0, 1, 0, 0, 0, 0,    3,   0,    0,  -1),
13075           new PlanetaryNutModel( 1, 2, 0, 2, 0, -1,  1,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
13076           new PlanetaryNutModel(-1, 2, 2, 2, 0,  0,  2,  0,-3, 0, 0, 0, 0,   -5,   0,    0,   2),
13077           new PlanetaryNutModel( 2, 2, 0, 2, 0,  0,  2,  0,-3, 0, 0, 0, 0,   24, -12,   -5, -11),
13078           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,   3,    1,   0),
13079           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,   3,    1,   0),
13080 
13081        /* 681-687 */
13082           new PlanetaryNutModel( 1, 1, 1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,   3,    2,   0),
13083           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,  -24, -12,   -5,  10),
13084           new PlanetaryNutModel( 2, 2, 0, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    4,   0,   -1,  -2),
13085           new PlanetaryNutModel(-1, 2, 2, 2, 0,  0,  2,  0,-2, 0, 0, 0, 0,   13,   0,    0,  -6),
13086           new PlanetaryNutModel(-1, 2, 2, 2, 0,  3, -3,  0, 0, 0, 0, 0, 0,    7,   0,    0,  -3),
13087           new PlanetaryNutModel( 1, 2, 0, 2, 0,  1, -1,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
13088           new PlanetaryNutModel( 0, 2, 2, 2, 0,  0,  2,  0,-2, 0, 0, 0, 0,    3,   0,    0,  -1)
13089        };
13090 
13091     /* Number of terms in the planetary nutation model */
13092        final int NPL = xpl.length;
13093 
13094     /*--------------------------------------------------------------------*/
13095 
13096     /* Interval between fundamental date J2000.0 and given date (JC). */
13097        t = ((date1 - DJ00) + date2) / DJC;
13098 
13099     /* ------------------- */
13100     /* LUNI-SOLAR NUTATION */
13101     /* ------------------- */
13102 
13103     /* Fundamental (Delaunay) arguments */
13104 
13105     /* Mean anomaly of the Moon (IERS 2003). */
13106        el = jauFal03(t);
13107 
13108     /* Mean anomaly of the Sun (MHB2000). */
13109        elp = fmod(1287104.79305  +
13110                 t * (129596581.0481  +
13111                 t * (-0.5532  +
13112                 t * (0.000136  +
13113                 t * (-0.00001149)))), TURNAS) * DAS2R;
13114 
13115     /* Mean longitude of the Moon minus that of the ascending node */
13116     /* (IERS 2003. */
13117        f = jauFaf03(t);
13118 
13119     /* Mean elongation of the Moon from the Sun (MHB2000). */
13120        d = fmod(1072260.70369  +
13121               t * (1602961601.2090  +
13122               t * (-6.3706  +
13123               t * (0.006593  +
13124               t * (-0.00003169)))), TURNAS) * DAS2R;
13125 
13126     /* Mean longitude of the ascending node of the Moon (IERS 2003). */
13127        om = jauFaom03(t);
13128 
13129     /* Initialize the nutation values. */
13130        dp = 0.0;
13131        de = 0.0;
13132 
13133     /* Summation of luni-solar nutation series (in reverse order). */
13134        for (i = NLS-1; i >= 0; i--) {
13135 
13136        /* Argument and functions. */
13137           arg = fmod((double)xls[i].nl  * el +
13138                      (double)xls[i].nlp * elp +
13139                      (double)xls[i].nf  * f +
13140                      (double)xls[i].nd  * d +
13141                      (double)xls[i].nom * om, D2PI);
13142           sarg = sin(arg);
13143           carg = cos(arg);
13144 
13145        /* Term. */
13146           dp += (xls[i].sp + xls[i].spt * t) * sarg + xls[i].cp * carg;
13147           de += (xls[i].ce + xls[i].cet * t) * carg + xls[i].se * sarg;
13148        }
13149 
13150     /* Convert from 0.1 microarcsec units to radians. */
13151        dpsils = dp * U2R;
13152        depsls = de * U2R;
13153 
13154     /* ------------------ */
13155     /* PLANETARY NUTATION */
13156     /* ------------------ */
13157 
13158     /* n.b.  The MHB2000 code computes the luni-solar and planetary nutation */
13159     /* in different functions, using slightly different Delaunay */
13160     /* arguments in the two cases.  This behaviour is faithfully */
13161     /* reproduced here.  Use of the IERS 2003 expressions for both */
13162     /* cases leads to negligible changes, well below */
13163     /* 0.1 microarcsecond. */
13164 
13165     /* Mean anomaly of the Moon (MHB2000). */
13166        al = fmod(2.35555598 + 8328.6914269554 * t, D2PI);
13167 
13168     /* Mean longitude of the Moon minus that of the ascending node */
13169     /*(MHB2000). */
13170        af = fmod(1.627905234 + 8433.466158131 * t, D2PI);
13171 
13172     /* Mean elongation of the Moon from the Sun (MHB2000). */
13173        ad = fmod(5.198466741 + 7771.3771468121 * t, D2PI);
13174 
13175     /* Mean longitude of the ascending node of the Moon (MHB2000). */
13176        aom = fmod(2.18243920 - 33.757045 * t, D2PI);
13177 
13178     /* General accumulated precession in longitude (IERS 2003). */
13179        apa = jauFapa03(t);
13180 
13181     /* Planetary longitudes, Mercury through Uranus (IERS 2003). */
13182        alme = jauFame03(t);
13183        alve = jauFave03(t);
13184        alea = jauFae03(t);
13185        alma = jauFama03(t);
13186        alju = jauFaju03(t);
13187        alsa = jauFasa03(t);
13188        alur = jauFaur03(t);
13189 
13190     /* Neptune longitude (MHB2000). */
13191        alne = fmod(5.321159000 + 3.8127774000 * t, D2PI);
13192 
13193     /* Initialize the nutation values. */
13194        dp = 0.0;
13195        de = 0.0;
13196 
13197     /* Summation of planetary nutation series (in reverse order). */
13198        for (i = NPL-1; i >= 0; i--) {
13199 
13200        /* Argument and functions. */
13201           arg = fmod((double)xpl[i].nl  * al   +
13202                      (double)xpl[i].nf  * af   +
13203                      (double)xpl[i].nd  * ad   +
13204                      (double)xpl[i].nom * aom  +
13205                      (double)xpl[i].nme * alme +
13206                      (double)xpl[i].nve * alve +
13207                      (double)xpl[i].nea * alea +
13208                      (double)xpl[i].nma * alma +
13209                      (double)xpl[i].nju * alju +
13210                      (double)xpl[i].nsa * alsa +
13211                      (double)xpl[i].nur * alur +
13212                      (double)xpl[i].nne * alne +
13213                      (double)xpl[i].npa * apa, D2PI);
13214           sarg = sin(arg);
13215           carg = cos(arg);
13216 
13217        /* Term. */
13218           dp += (double)xpl[i].sp * sarg + (double)xpl[i].cp * carg;
13219           de += (double)xpl[i].se * sarg + (double)xpl[i].ce * carg;
13220 
13221        }
13222 
13223     /* Convert from 0.1 microarcsec units to radians. */
13224        dpsipl = dp * U2R;
13225        depspl = de * U2R;
13226 
13227     /* ------- */
13228     /* RESULTS */
13229     /* ------- */
13230 
13231     /* Add luni-solar and planetary components. */
13232        return new NutationTerms( dpsils + dpsipl,
13233                                depsls + depspl);
13234        }
13235     
13236      private final static class LSNutationModel 
13237         {
13238           final int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */
13239           final double ps,pst,pc;     /* longitude sin, t*sin, cos coefficients */
13240           final double ec,ect,es;     /* obliquity cos, t*cos, sin coefficients */
13241           
13242           public LSNutationModel( int nl,int nlp,int nf,int nd,int nom,
13243           double ps, double pst, double pc,    
13244           double ec, double ect, double es    ) {
13245                this.nl = nl;this.nlp = nlp;this.nf = nf;this.nd = nd;this.nom = nom;
13246                this.ps = ps;this.pst = pst;this.pc = pc;    
13247                this.ec = ec;this.ect = ect; this.es= es;    
13248         }
13249 
13250        }
13251 
13252     /**
13253     *  Nutation, IAU 2000B model.
13254     *
13255     *<p>This function is derived from the International Astronomical Union's
13256     *  SOFA (Standards Of Fundamental Astronomy) software collection.
13257     *
13258     *<p>Status:  canonical model.
13259     *
13260     *<!-- Given: -->
13261     *     @param date1 double TT as a 2-part Julian Date (Note 1)
13262     *     @param date2 double TT as a 2-part Julian Date (Note 1)
13263     *
13264     *<!-- Returned: -->
13265     *     @return  nutation, luni-solar + planetary (Note 2)
13266     *
13267     * <p>Notes:
13268     * <ol>
13269     *
13270     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13271     *     convenient way between the two arguments.  For example,
13272     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13273     *     among others:
13274     *<pre>
13275     *            date1          date2
13276     *
13277     *         2450123.7           0.0       (JD method)
13278     *         2451545.0       -1421.3       (J2000 method)
13279     *         2400000.5       50123.2       (MJD method)
13280     *         2450123.5           0.2       (date &amp; time method)
13281     *</pre>
13282     *     The JD method is the most natural and convenient to use in
13283     *     cases where the loss of several decimal digits of resolution
13284     *     is acceptable.  The J2000 method is best matched to the way
13285     *     the argument is handled internally and will deliver the
13286     *     optimum resolution.  The MJD method and the date &amp; time methods
13287     *     are both good compromises between resolution and convenience.
13288     *
13289     * <li> The nutation components in longitude and obliquity are in radians
13290     *     and with respect to the equinox and ecliptic of date.  The
13291     *     obliquity at J2000.0 is assumed to be the Lieske et al. (1977)
13292     *     value of 84381.448 arcsec.  (The errors that result from using
13293     *     this function with the IAU 2006 value of 84381.406 arcsec can be
13294     *     neglected.)
13295     *
13296     *     The nutation model consists only of luni-solar terms, but
13297     *     includes also a fixed offset which compensates for certain long-
13298     *     period planetary terms (Note 7).
13299     *
13300     * <li> This function is an implementation of the IAU 2000B abridged
13301     *     nutation model formally adopted by the IAU General Assembly in
13302     *     2000.  The function computes the MHB_2000_SHORT luni-solar
13303     *     nutation series (Luzum 2001), but without the associated
13304     *     corrections for the precession rate adjustments and the offset
13305     *     between the GCRS and J2000.0 mean poles.
13306     *
13307     * <li> The full IAU 2000A (MHB2000) nutation model contains nearly 1400
13308     *     terms.  The IAU 2000B model (McCarthy &amp; Luzum 2003) contains only
13309     *     77 terms, plus additional simplifications, yet still delivers
13310     *     results of 1 mas accuracy at present epochs.  This combination of
13311     *     accuracy and size makes the IAU 2000B abridged nutation model
13312     *     suitable for most practical applications.
13313     *
13314     *     The function delivers a pole accurate to 1 mas from 1900 to 2100
13315     *     (usually better than 1 mas, very occasionally just outside
13316     *     1 mas).  The full IAU 2000A model, which is implemented in the
13317     *     function jauNut00a (q.v.), delivers considerably greater accuracy
13318     *     at current dates;  however, to realize this improved accuracy,
13319     *     corrections for the essentially unpredictable free-core-nutation
13320     *     (FCN) must also be included.
13321     *
13322     * <li> The present function provides classical nutation.  The
13323     *     MHB_2000_SHORT algorithm, from which it is adapted, deals also
13324     *     with (i) the offsets between the GCRS and mean poles and (ii) the
13325     *     adjustments in longitude and obliquity due to the changed
13326     *     precession rates.  These additional functions, namely frame bias
13327     *     and precession adjustments, are supported by the JSOFA functions
13328     *     jauBi00  and jauPr00.
13329     *
13330     * <li> The MHB_2000_SHORT algorithm also provides "total" nutations,
13331     *     comprising the arithmetic sum of the frame bias, precession
13332     *     adjustments, and nutation (luni-solar + planetary).  These total
13333     *     nutations can be used in combination with an existing IAU 1976
13334     *     precession implementation, such as jauPmat76,  to deliver GCRS-
13335     *     to-true predictions of mas accuracy at current epochs.  However,
13336     *     for symmetry with the jauNut00a  function (q.v. for the reasons),
13337     *     the JSOFA functions do not generate the "total nutations"
13338     *     directly.  Should they be required, they could of course easily
13339     *     be generated by calling jauBi00, jauPr00 and the present function
13340     *     and adding the results.
13341     *
13342     * <li> The IAU 2000B model includes "planetary bias" terms that are
13343     *     fixed in size but compensate for long-period nutations.  The
13344     *     amplitudes quoted in McCarthy &amp; Luzum (2003), namely
13345     *     Dpsi = -1.5835 mas and Depsilon = +1.6339 mas, are optimized for
13346     *     the "total nutations" method described in Note 6.  The Luzum
13347     *     (2001) values used in this JSOFA implementation, namely -0.135 mas
13348     *     and +0.388 mas, are optimized for the "rigorous" method, where
13349     *     frame bias, precession and nutation are applied separately and in
13350     *     that order.  During the interval 1995-2050, the JSOFA
13351     *     implementation delivers a maximum error of 1.001 mas (not
13352     *     including FCN).
13353     *</ol>
13354     *<p>References:
13355     *
13356     *     <p>Lieske, J.H., Lederle, T., Fricke, W., Morando, B., "Expressions
13357     *     for the precession quantities based upon the IAU /1976/ system of
13358     *     astronomical constants", Astron.Astrophys. 58, 1-2, 1-16. (1977)
13359     *
13360     *     <p>Luzum, B., private communication, 2001 (Fortran code
13361     *     MHB_2000_SHORT)
13362     *
13363     *     <p>McCarthy, D.D. &amp; Luzum, B.J., "An abridged model of the
13364     *     precession-nutation of the celestial pole", Cel.Mech.Dyn.Astron.
13365     *     85, 37-49 (2003)
13366     *
13367     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
13368     *     Francou, G., Laskar, J., Astron.Astrophys. 282, 663-683 (1994)
13369     *
13370     *@version 2009 December 17
13371     *
13372     *  @since Release 20101201
13373     *
13374     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13375     */
13376     public static NutationTerms jauNut00b(double date1, double date2)
13377     {
13378        double t, el, elp, f, d, om, arg, dp, de, sarg, carg,
13379               dpsils, depsls, dpsipl, depspl;
13380        int i;
13381 
13382     /* Units of 0.1 microarcsecond to radians */
13383        final double U2R = DAS2R / 1e7;
13384 
13385     /* ---------------------------------------- */
13386     /* Fixed offsets in lieu of planetary terms */
13387     /* ---------------------------------------- */
13388 
13389        final double DPPLAN = -0.135 * DMAS2R;
13390        final double DEPLAN =  0.388 * DMAS2R;
13391 
13392     /* --------------------------------------------------- */
13393     /* Luni-solar nutation: argument and term coefficients */
13394     /* --------------------------------------------------- */
13395 
13396     /* The units for the sine and cosine coefficients are */
13397     /* 0.1 microarcsec and the same per Julian century    */
13398 
13399         LSNutationModel x[] = {
13400 
13401        /* 1-10 */
13402           new LSNutationModel( 0, 0, 0, 0,1,
13403              -172064161.0, -174666.0, 33386.0, 92052331.0, 9086.0, 15377.0),
13404           new LSNutationModel( 0, 0, 2,-2,2,
13405                -13170906.0, -1675.0, -13696.0, 5730336.0, -3015.0, -4587.0),
13406           new LSNutationModel( 0, 0, 2, 0,2,-2276413.0,-234.0, 2796.0, 978459.0,-485.0,1374.0),
13407           new LSNutationModel( 0, 0, 0, 0,2,2074554.0,  207.0, -698.0,-897492.0, 470.0,-291.0),
13408           new LSNutationModel( 0, 1, 0, 0,0,1475877.0,-3633.0,11817.0, 73871.0,-184.0,-1924.0),
13409           new LSNutationModel( 0, 1, 2,-2,2,-516821.0, 1226.0, -524.0, 224386.0,-677.0,-174.0),
13410           new LSNutationModel( 1, 0, 0, 0,0, 711159.0,   73.0, -872.0,  -6750.0,   0.0, 358.0),
13411           new LSNutationModel( 0, 0, 2, 0,1,-387298.0, -367.0,  380.0, 200728.0,  18.0, 318.0),
13412           new LSNutationModel( 1, 0, 2, 0,2,-301461.0,  -36.0,  816.0, 129025.0, -63.0, 367.0),
13413           new LSNutationModel( 0,-1, 2,-2,2, 215829.0, -494.0,  111.0, -95929.0, 299.0, 132.0),
13414 
13415        /* 11-20 */
13416           new LSNutationModel( 0, 0, 2,-2,1, 128227.0,  137.0,  181.0, -68982.0,  -9.0,  39.0),
13417           new LSNutationModel(-1, 0, 2, 0,2, 123457.0,   11.0,   19.0, -53311.0,  32.0,  -4.0),
13418           new LSNutationModel(-1, 0, 0, 2,0, 156994.0,   10.0, -168.0,  -1235.0,   0.0,  82.0),
13419           new LSNutationModel( 1, 0, 0, 0,1,  63110.0,   63.0,   27.0, -33228.0,   0.0,  -9.0),
13420           new LSNutationModel(-1, 0, 0, 0,1, -57976.0,  -63.0, -189.0,  31429.0,   0.0, -75.0),
13421           new LSNutationModel(-1, 0, 2, 2,2, -59641.0,  -11.0,  149.0,  25543.0, -11.0,  66.0),
13422           new LSNutationModel( 1, 0, 2, 0,1, -51613.0,  -42.0,  129.0,  26366.0,   0.0,  78.0),
13423           new LSNutationModel(-2, 0, 2, 0,1,  45893.0,   50.0,   31.0, -24236.0, -10.0,  20.0),
13424           new LSNutationModel( 0, 0, 0, 2,0,  63384.0,   11.0, -150.0,  -1220.0,   0.0,  29.0),
13425           new LSNutationModel( 0, 0, 2, 2,2, -38571.0,   -1.0,  158.0,  16452.0, -11.0,  68.0),
13426 
13427        /* 21-30 */
13428           new LSNutationModel( 0,-2, 2,-2,2,  32481.0,    0.0,    0.0, -13870.0,   0.0,   0.0),
13429           new LSNutationModel(-2, 0, 0, 2,0, -47722.0,    0.0,  -18.0,    477.0,   0.0, -25.0),
13430           new LSNutationModel( 2, 0, 2, 0,2, -31046.0,   -1.0,  131.0,  13238.0, -11.0,  59.0),
13431           new LSNutationModel( 1, 0, 2,-2,2,  28593.0,    0.0,   -1.0, -12338.0,  10.0,  -3.0),
13432           new LSNutationModel(-1, 0, 2, 0,1,  20441.0,   21.0,   10.0, -10758.0,   0.0,  -3.0),
13433           new LSNutationModel( 2, 0, 0, 0,0,  29243.0,    0.0,  -74.0,   -609.0,   0.0,  13.0),
13434           new LSNutationModel( 0, 0, 2, 0,0,  25887.0,    0.0,  -66.0,   -550.0,   0.0,  11.0),
13435           new LSNutationModel( 0, 1, 0, 0,1, -14053.0,  -25.0,   79.0,   8551.0,  -2.0, -45.0),
13436           new LSNutationModel(-1, 0, 0, 2,1,  15164.0,   10.0,   11.0,  -8001.0,   0.0,  -1.0),
13437           new LSNutationModel( 0, 2, 2,-2,2, -15794.0,   72.0,  -16.0,   6850.0, -42.0,  -5.0),
13438 
13439        /* 31-40 */
13440           new LSNutationModel( 0, 0,-2, 2,0,  21783.0,    0.0,   13.0,   -167.0,   0.0,  13.0),
13441           new LSNutationModel( 1, 0, 0,-2,1, -12873.0,  -10.0,  -37.0,   6953.0,   0.0, -14.0),
13442           new LSNutationModel( 0,-1, 0, 0,1, -12654.0,   11.0,   63.0,   6415.0,   0.0,  26.0),
13443           new LSNutationModel(-1, 0, 2, 2,1, -10204.0,    0.0,   25.0,   5222.0,   0.0,  15.0),
13444           new LSNutationModel( 0, 2, 0, 0,0,  16707.0,  -85.0,  -10.0,    168.0,  -1.0,  10.0),
13445           new LSNutationModel( 1, 0, 2, 2,2,  -7691.0,    0.0,   44.0,   3268.0,   0.0,  19.0),
13446           new LSNutationModel(-2, 0, 2, 0,0, -11024.0,    0.0,  -14.0,    104.0,   0.0,   2.0),
13447           new LSNutationModel( 0, 1, 2, 0,2,   7566.0,  -21.0,  -11.0,  -3250.0,   0.0,  -5.0),
13448           new LSNutationModel( 0, 0, 2, 2,1,  -6637.0,  -11.0,   25.0,   3353.0,   0.0,  14.0),
13449           new LSNutationModel( 0,-1, 2, 0,2,  -7141.0,   21.0,    8.0,   3070.0,   0.0,   4.0),
13450 
13451        /* 41-50 */
13452           new LSNutationModel( 0, 0, 0, 2,1,  -6302.0,  -11.0,    2.0,   3272.0,   0.0,   4.0),
13453           new LSNutationModel( 1, 0, 2,-2,1,   5800.0,   10.0,    2.0,  -3045.0,   0.0,  -1.0),
13454           new LSNutationModel( 2, 0, 2,-2,2,   6443.0,    0.0,   -7.0,  -2768.0,   0.0,  -4.0),
13455           new LSNutationModel(-2, 0, 0, 2,1,  -5774.0,  -11.0,  -15.0,   3041.0,   0.0,  -5.0),
13456           new LSNutationModel( 2, 0, 2, 0,1,  -5350.0,    0.0,   21.0,   2695.0,   0.0,  12.0),
13457           new LSNutationModel( 0,-1, 2,-2,1,  -4752.0,  -11.0,   -3.0,   2719.0,   0.0,  -3.0),
13458           new LSNutationModel( 0, 0, 0,-2,1,  -4940.0,  -11.0,  -21.0,   2720.0,   0.0,  -9.0),
13459           new LSNutationModel(-1,-1, 0, 2,0,   7350.0,    0.0,   -8.0,    -51.0,   0.0,   4.0),
13460           new LSNutationModel( 2, 0, 0,-2,1,   4065.0,    0.0,    6.0,  -2206.0,   0.0,   1.0),
13461           new LSNutationModel( 1, 0, 0, 2,0,   6579.0,    0.0,  -24.0,   -199.0,   0.0,   2.0),
13462 
13463        /* 51-60 */
13464           new LSNutationModel( 0, 1, 2,-2,1,   3579.0,    0.0,    5.0,  -1900.0,   0.0,   1.0),
13465           new LSNutationModel( 1,-1, 0, 0,0,   4725.0,    0.0,   -6.0,    -41.0,   0.0,   3.0),
13466           new LSNutationModel(-2, 0, 2, 0,2,  -3075.0,    0.0,   -2.0,   1313.0,   0.0,  -1.0),
13467           new LSNutationModel( 3, 0, 2, 0,2,  -2904.0,    0.0,   15.0,   1233.0,   0.0,   7.0),
13468           new LSNutationModel( 0,-1, 0, 2,0,   4348.0,    0.0,  -10.0,    -81.0,   0.0,   2.0),
13469           new LSNutationModel( 1,-1, 2, 0,2,  -2878.0,    0.0,    8.0,   1232.0,   0.0,   4.0),
13470           new LSNutationModel( 0, 0, 0, 1,0,  -4230.0,    0.0,    5.0,    -20.0,   0.0,  -2.0),
13471           new LSNutationModel(-1,-1, 2, 2,2,  -2819.0,    0.0,    7.0,   1207.0,   0.0,   3.0),
13472           new LSNutationModel(-1, 0, 2, 0,0,  -4056.0,    0.0,    5.0,     40.0,   0.0,  -2.0),
13473           new LSNutationModel( 0,-1, 2, 2,2,  -2647.0,    0.0,   11.0,   1129.0,   0.0,   5.0),
13474 
13475        /* 61-70 */
13476           new LSNutationModel(-2, 0, 0, 0,1,  -2294.0,    0.0,  -10.0,   1266.0,   0.0,  -4.0),
13477           new LSNutationModel( 1, 1, 2, 0,2,   2481.0,    0.0,   -7.0,  -1062.0,   0.0,  -3.0),
13478           new LSNutationModel( 2, 0, 0, 0,1,   2179.0,    0.0,   -2.0,  -1129.0,   0.0,  -2.0),
13479           new LSNutationModel(-1, 1, 0, 1,0,   3276.0,    0.0,    1.0,     -9.0,   0.0,   0.0),
13480           new LSNutationModel( 1, 1, 0, 0,0,  -3389.0,    0.0,    5.0,     35.0,   0.0,  -2.0),
13481           new LSNutationModel( 1, 0, 2, 0,0,   3339.0,    0.0,  -13.0,   -107.0,   0.0,   1.0),
13482           new LSNutationModel(-1, 0, 2,-2,1,  -1987.0,    0.0,   -6.0,   1073.0,   0.0,  -2.0),
13483           new LSNutationModel( 1, 0, 0, 0,2,  -1981.0,    0.0,    0.0,    854.0,   0.0,   0.0),
13484           new LSNutationModel(-1, 0, 0, 1,0,   4026.0,    0.0, -353.0,   -553.0,   0.0,-139.0),
13485           new LSNutationModel( 0, 0, 2, 1,2,   1660.0,    0.0,   -5.0,   -710.0,   0.0,  -2.0),
13486 
13487        /* 71-77 */
13488           new LSNutationModel(-1, 0, 2, 4,2,  -1521.0,    0.0,    9.0,    647.0,   0.0,   4.0),
13489           new LSNutationModel(-1, 1, 0, 1,1,   1314.0,    0.0,    0.0,   -700.0,   0.0,   0.0),
13490           new LSNutationModel( 0,-2, 2,-2,1,  -1283.0,    0.0,    0.0,    672.0,   0.0,   0.0),
13491           new LSNutationModel( 1, 0, 2, 2,1,  -1331.0,    0.0,    8.0,    663.0,   0.0,   4.0),
13492           new LSNutationModel(-2, 0, 2, 2,2,   1383.0,    0.0,   -2.0,   -594.0,   0.0,  -2.0),
13493           new LSNutationModel(-1, 0, 0, 0,2,   1405.0,    0.0,    4.0,   -610.0,   0.0,   2.0),
13494           new LSNutationModel( 1, 1, 2,-2,2,   1290.0,    0.0,    0.0,   -556.0,   0.0,   0.0)
13495        };
13496 
13497     /* Number of terms in the series */
13498        final int NLS = x.length;
13499 
13500     /*--------------------------------------------------------------------*/
13501 
13502     /* Interval between fundamental epoch J2000.0 and given date (JC). */
13503        t = ((date1 - DJ00) + date2) / DJC;
13504 
13505     /* --------------------*/
13506     /* LUNI-SOLAR NUTATION */
13507     /* --------------------*/
13508 
13509     /* Fundamental (Delaunay) arguments from Simon et al. (1994) */
13510 
13511     /* Mean anomaly of the Moon. */
13512        el = fmod(485868.249036 + (1717915923.2178) * t, TURNAS) * DAS2R;
13513 
13514     /* Mean anomaly of the Sun. */
13515        elp = fmod(1287104.79305 + (129596581.0481) * t, TURNAS) * DAS2R;
13516 
13517     /* Mean argument of the latitude of the Moon. */
13518        f = fmod(335779.526232 + (1739527262.8478) * t, TURNAS) * DAS2R;
13519 
13520     /* Mean elongation of the Moon from the Sun. */
13521        d = fmod(1072260.70369 + (1602961601.2090) * t, TURNAS) * DAS2R;
13522 
13523     /* Mean longitude of the ascending node of the Moon. */
13524        om = fmod(450160.398036 + (-6962890.5431) * t, TURNAS) * DAS2R;
13525 
13526     /* Initialize the nutation values. */
13527        dp = 0.0;
13528        de = 0.0;
13529 
13530     /* Summation of luni-solar nutation series (smallest terms first). */
13531        for (i = NLS-1; i >= 0; i--) {
13532 
13533        /* Argument and functions. */
13534           arg = fmod( (double)x[i].nl  * el  +
13535                       (double)x[i].nlp * elp +
13536                       (double)x[i].nf  * f   +
13537                       (double)x[i].nd  * d   +
13538                       (double)x[i].nom * om, D2PI  );
13539           sarg = sin(arg);
13540           carg = cos(arg);
13541 
13542        /* Term. */
13543           dp += (x[i].ps + x[i].pst * t) * sarg + x[i].pc * carg;
13544           de += (x[i].ec + x[i].ect * t) * carg + x[i].es * sarg;
13545        }
13546 
13547     /* Convert from 0.1 microarcsec units to radians. */
13548        dpsils = dp * U2R;
13549        depsls = de * U2R;
13550 
13551     /* ------------------------------*/
13552     /* IN LIEU OF PLANETARY NUTATION */
13553     /* ------------------------------*/
13554 
13555     /* Fixed offset to correct for missing terms in truncated series. */
13556        dpsipl = DPPLAN;
13557        depspl = DEPLAN;
13558 
13559     /* --------*/
13560     /* RESULTS */
13561     /* --------*/
13562 
13563     /* Add luni-solar and planetary components. */
13564        return new NutationTerms(   dpsils + dpsipl,
13565                                 depsls + depspl);
13566 
13567     }
13568     
13569 
13570     /**
13571     *  IAU 2000A nutation with adjustments to match the IAU 2006
13572     *  precession.
13573     *
13574     *<!-- Given: -->
13575     *     @param date1 double TT as a 2-part Julian Date (Note 1)
13576     *     @param date2 double TT as a 2-part Julian Date (Note 1)
13577     *
13578     *<!-- Returned: -->
13579     *     @return  nutation, luni-solar + planetary (Note 2)
13580     *
13581     *<p>Status:  canonical model.
13582     *
13583     * <p>Notes:
13584     * <ol>
13585     *
13586     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13587     *     convenient way between the two arguments.  For example,
13588     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13589     *     among others:
13590     *<pre>
13591     *            date1          date2
13592     *
13593     *         2450123.7           0.0       (JD method)
13594     *         2451545.0       -1421.3       (J2000 method)
13595     *         2400000.5       50123.2       (MJD method)
13596     *         2450123.5           0.2       (date &amp; time method)
13597     *</pre>
13598     *     The JD method is the most natural and convenient to use in
13599     *     cases where the loss of several decimal digits of resolution
13600     *     is acceptable.  The J2000 method is best matched to the way
13601     *     the argument is handled internally and will deliver the
13602     *     optimum resolution.  The MJD method and the date &amp; time methods
13603     *     are both good compromises between resolution and convenience.
13604     *
13605     * <li> The nutation components in longitude and obliquity are in radians
13606     *     and with respect to the mean equinox and ecliptic of date,
13607     *     IAU 2006 precession model (Hilton et al. 2006, Capitaine et al.
13608     *     2005).
13609     *
13610     * <li> The function first computes the IAU 2000A nutation, then applies
13611     *     adjustments for (i) the consequences of the change in obliquity
13612     *     from the IAU 1980 ecliptic to the IAU 2006 ecliptic and (ii) the
13613     *     secular variation in the Earth's dynamical flattening.
13614     *
13615     * <li> The present function provides classical nutation, complementing
13616     *     the IAU 2000 frame bias and IAU 2006 precession.  It delivers a
13617     *     pole which is at current epochs accurate to a few tens of
13618     *     microarcseconds, apart from the free core nutation.
13619     *</ol>
13620     *<p>Called:<ul>
13621     *     <li>{@link #jauNut00a} nutation, IAU 2000A
13622     * </ul>
13623     *<p>References:
13624     *
13625     *     <p>Chapront, J., Chapront-Touze, M. &amp; Francou, G. 2002,
13626     *     Astron.Astrophys. 387, 700
13627     *
13628     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B. 1977,
13629     *     Astron.Astrophys. 58, 1-16
13630     *
13631     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A. 2002, J.Geophys.Res.
13632     *     107, B4.  The MHB_2000 code itself was obtained on 9th September
13633     *     2002 from ftp//maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
13634     *
13635     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
13636     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
13637     *
13638     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
13639     *     Astron.Astrophys.Supp.Ser. 135, 111
13640     *
13641     *    <p>Wallace, P.T., "Software for Implementing the IAU 2000
13642     *     Resolutions", in IERS Workshop 5.1 (2002)
13643     *
13644     *@version 2008 May 24
13645     *
13646     *  @since Release 20101201
13647     *
13648     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13649     */
13650     public static NutationTerms jauNut06a(double date1, double date2)
13651     {
13652        double t, fj2;
13653 
13654 
13655     /* Interval between fundamental date J2000.0 and given date (JC). */
13656        t = ((date1 - DJ00) + date2) / DJC;
13657 
13658     /* Factor correcting for secular variation of J2. */
13659        fj2 = -2.7774e-6 * t;
13660 
13661     /* Obtain IAU 2000A nutation. */
13662        NutationTerms nt = jauNut00a(date1, date2);
13663        
13664     /* Apply P03 adjustments (Wallace &amp; Capitaine, 2006, Eqs.5). */
13665        return new NutationTerms( nt.dpsi + nt.dpsi * (0.4697e-6 + fj2),
13666                                  nt.deps + nt.deps * fj2);
13667 
13668      }
13669     
13670      private final static class NutationModel2 {
13671           final int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */
13672           final double sp,spt;        /* longitude sine, 1 and t coefficients */
13673           final double ce,cet;        /* obliquity cosine, 1 and t coefficients */
13674           
13675           public NutationModel2(int nl,int nlp,int nf,int nd,int nom,
13676           double sp,double spt,       
13677           double ce,double cet       ) {
13678                this.nl = nl;this.nlp = nlp;this.nf = nf;this.nd = nd;this.nom = nom;
13679                this.sp = sp;this.spt = spt;      
13680                this.ce = ce;this.cet = cet;     
13681         }
13682        }
13683    /**
13684     *  Nutation, IAU 1980 model.
13685     *
13686     *<p>This function is derived from the International Astronomical Union's
13687     *  SOFA (Standards Of Fundamental Astronomy) software collection.
13688     *
13689     *<p>Status:  canonical model.
13690     *
13691     *<!-- Given: -->
13692     *     @param date1 double TT as a 2-part Julian Date (Note 1)
13693     *     @param date2 double TT as a 2-part Julian Date (Note 1)
13694     *
13695     *<!-- Returned: -->
13696     *     @return dpsi           double      <u>returned</u> nutation in longitude (radians)
13697     *             deps           double      <u>returned</u> nutation in obliquity (radians)
13698     *
13699     * <p>Notes:
13700     * <ol>
13701     *
13702     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13703     *     convenient way between the two arguments.  For example,
13704     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13705     *     among others:
13706     *<pre>
13707     *            date1          date2
13708     *
13709     *         2450123.7           0.0       (JD method)
13710     *         2451545.0       -1421.3       (J2000 method)
13711     *         2400000.5       50123.2       (MJD method)
13712     *         2450123.5           0.2       (date &amp; time method)
13713     *</pre>
13714     *     The JD method is the most natural and convenient to use in
13715     *     cases where the loss of several decimal digits of resolution
13716     *     is acceptable.  The J2000 method is best matched to the way
13717     *     the argument is handled internally and will deliver the
13718     *     optimum resolution.  The MJD method and the date &amp; time methods
13719     *     are both good compromises between resolution and convenience.
13720     *
13721     * <li> The nutation components are with respect to the ecliptic of
13722     *     date.
13723     *</ol>
13724     *<p>Called:<ul>
13725     *     <li>{@link #jauAnpm} normalize angle into range +/- pi
13726     * </ul>
13727     *<p>Reference:
13728     *
13729     *     <p>Explanatory Supplement to the Astronomical Almanac,
13730     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
13731     *     Section 3.222 (p111).
13732     *
13733     *@version 2008 September 30
13734     *
13735     *  @since Release 20101201
13736     *
13737     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13738     */
13739     public static NutationTerms jauNut80(double date1, double date2)
13740     {
13741        double t, el, elp, f, d, om, dp, de, arg, s, c;
13742        int j;
13743 
13744     /* Units of 0.1 milliarcsecond to radians */
13745        final double U2R = DAS2R / 1e4;
13746 
13747     /* ------------------------------------------------ */
13748     /* Table of multiples of arguments and coefficients */
13749     /* ------------------------------------------------ */
13750 
13751     /* The units for the sine and cosine coefficients are 0.1 mas and */
13752     /* the same per Julian century */
13753 
13754        NutationModel2 x[] = {
13755 
13756        /* 1-10 */
13757           new NutationModel2(  0,  0,  0,  0,  1, -171996.0, -174.2,  92025.0,    8.9 ),
13758           new NutationModel2(  0,  0,  0,  0,  2,    2062.0,    0.2,   -895.0,    0.5 ),
13759           new NutationModel2( -2,  0,  2,  0,  1,      46.0,    0.0,    -24.0,    0.0 ),
13760           new NutationModel2(  2,  0, -2,  0,  0,      11.0,    0.0,      0.0,    0.0 ),
13761           new NutationModel2( -2,  0,  2,  0,  2,      -3.0,    0.0,      1.0,    0.0 ),
13762           new NutationModel2(  1, -1,  0, -1,  0,      -3.0,    0.0,      0.0,    0.0 ),
13763           new NutationModel2(  0, -2,  2, -2,  1,      -2.0,    0.0,      1.0,    0.0 ),
13764           new NutationModel2(  2,  0, -2,  0,  1,       1.0,    0.0,      0.0,    0.0 ),
13765           new NutationModel2(  0,  0,  2, -2,  2,  -13187.0,   -1.6,   5736.0,   -3.1 ),
13766           new NutationModel2(  0,  1,  0,  0,  0,    1426.0,   -3.4,     54.0,   -0.1 ),
13767 
13768        /* 11-20 */
13769           new NutationModel2(  0,  1,  2, -2,  2,    -517.0,    1.2,    224.0,   -0.6 ),
13770           new NutationModel2(  0, -1,  2, -2,  2,     217.0,   -0.5,    -95.0,    0.3 ),
13771           new NutationModel2(  0,  0,  2, -2,  1,     129.0,    0.1,    -70.0,    0.0 ),
13772           new NutationModel2(  2,  0,  0, -2,  0,      48.0,    0.0,      1.0,    0.0 ),
13773           new NutationModel2(  0,  0,  2, -2,  0,     -22.0,    0.0,      0.0,    0.0 ),
13774           new NutationModel2(  0,  2,  0,  0,  0,      17.0,   -0.1,      0.0,    0.0 ),
13775           new NutationModel2(  0,  1,  0,  0,  1,     -15.0,    0.0,      9.0,    0.0 ),
13776           new NutationModel2(  0,  2,  2, -2,  2,     -16.0,    0.1,      7.0,    0.0 ),
13777           new NutationModel2(  0, -1,  0,  0,  1,     -12.0,    0.0,      6.0,    0.0 ),
13778           new NutationModel2( -2,  0,  0,  2,  1,      -6.0,    0.0,      3.0,    0.0 ),
13779 
13780        /* 21-30 */
13781           new NutationModel2(  0, -1,  2, -2,  1,      -5.0,    0.0,      3.0,    0.0 ),
13782           new NutationModel2(  2,  0,  0, -2,  1,       4.0,    0.0,     -2.0,    0.0 ),
13783           new NutationModel2(  0,  1,  2, -2,  1,       4.0,    0.0,     -2.0,    0.0 ),
13784           new NutationModel2(  1,  0,  0, -1,  0,      -4.0,    0.0,      0.0,    0.0 ),
13785           new NutationModel2(  2,  1,  0, -2,  0,       1.0,    0.0,      0.0,    0.0 ),
13786           new NutationModel2(  0,  0, -2,  2,  1,       1.0,    0.0,      0.0,    0.0 ),
13787           new NutationModel2(  0,  1, -2,  2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13788           new NutationModel2(  0,  1,  0,  0,  2,       1.0,    0.0,      0.0,    0.0 ),
13789           new NutationModel2( -1,  0,  0,  1,  1,       1.0,    0.0,      0.0,    0.0 ),
13790           new NutationModel2(  0,  1,  2, -2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13791 
13792        /* 31-40 */
13793           new NutationModel2(  0,  0,  2,  0,  2,   -2274.0,   -0.2,    977.0,   -0.5 ),
13794           new NutationModel2(  1,  0,  0,  0,  0,     712.0,    0.1,     -7.0,    0.0 ),
13795           new NutationModel2(  0,  0,  2,  0,  1,    -386.0,   -0.4,    200.0,    0.0 ),
13796           new NutationModel2(  1,  0,  2,  0,  2,    -301.0,    0.0,    129.0,   -0.1 ),
13797           new NutationModel2(  1,  0,  0, -2,  0,    -158.0,    0.0,     -1.0,    0.0 ),
13798           new NutationModel2( -1,  0,  2,  0,  2,     123.0,    0.0,    -53.0,    0.0 ),
13799           new NutationModel2(  0,  0,  0,  2,  0,      63.0,    0.0,     -2.0,    0.0 ),
13800           new NutationModel2(  1,  0,  0,  0,  1,      63.0,    0.1,    -33.0,    0.0 ),
13801           new NutationModel2( -1,  0,  0,  0,  1,     -58.0,   -0.1,     32.0,    0.0 ),
13802           new NutationModel2( -1,  0,  2,  2,  2,     -59.0,    0.0,     26.0,    0.0 ),
13803 
13804        /* 41-50 */
13805           new NutationModel2(  1,  0,  2,  0,  1,     -51.0,    0.0,     27.0,    0.0 ),
13806           new NutationModel2(  0,  0,  2,  2,  2,     -38.0,    0.0,     16.0,    0.0 ),
13807           new NutationModel2(  2,  0,  0,  0,  0,      29.0,    0.0,     -1.0,    0.0 ),
13808           new NutationModel2(  1,  0,  2, -2,  2,      29.0,    0.0,    -12.0,    0.0 ),
13809           new NutationModel2(  2,  0,  2,  0,  2,     -31.0,    0.0,     13.0,    0.0 ),
13810           new NutationModel2(  0,  0,  2,  0,  0,      26.0,    0.0,     -1.0,    0.0 ),
13811           new NutationModel2( -1,  0,  2,  0,  1,      21.0,    0.0,    -10.0,    0.0 ),
13812           new NutationModel2( -1,  0,  0,  2,  1,      16.0,    0.0,     -8.0,    0.0 ),
13813           new NutationModel2(  1,  0,  0, -2,  1,     -13.0,    0.0,      7.0,    0.0 ),
13814           new NutationModel2( -1,  0,  2,  2,  1,     -10.0,    0.0,      5.0,    0.0 ),
13815 
13816        /* 51-60 */
13817           new NutationModel2(  1,  1,  0, -2,  0,      -7.0,    0.0,      0.0,    0.0 ),
13818           new NutationModel2(  0,  1,  2,  0,  2,       7.0,    0.0,     -3.0,    0.0 ),
13819           new NutationModel2(  0, -1,  2,  0,  2,      -7.0,    0.0,      3.0,    0.0 ),
13820           new NutationModel2(  1,  0,  2,  2,  2,      -8.0,    0.0,      3.0,    0.0 ),
13821           new NutationModel2(  1,  0,  0,  2,  0,       6.0,    0.0,      0.0,    0.0 ),
13822           new NutationModel2(  2,  0,  2, -2,  2,       6.0,    0.0,     -3.0,    0.0 ),
13823           new NutationModel2(  0,  0,  0,  2,  1,      -6.0,    0.0,      3.0,    0.0 ),
13824           new NutationModel2(  0,  0,  2,  2,  1,      -7.0,    0.0,      3.0,    0.0 ),
13825           new NutationModel2(  1,  0,  2, -2,  1,       6.0,    0.0,     -3.0,    0.0 ),
13826           new NutationModel2(  0,  0,  0, -2,  1,      -5.0,    0.0,      3.0,    0.0 ),
13827 
13828        /* 61-70 */
13829           new NutationModel2(  1, -1,  0,  0,  0,       5.0,    0.0,      0.0,    0.0 ),
13830           new NutationModel2(  2,  0,  2,  0,  1,      -5.0,    0.0,      3.0,    0.0 ),
13831           new NutationModel2(  0,  1,  0, -2,  0,      -4.0,    0.0,      0.0,    0.0 ),
13832           new NutationModel2(  1,  0, -2,  0,  0,       4.0,    0.0,      0.0,    0.0 ),
13833           new NutationModel2(  0,  0,  0,  1,  0,      -4.0,    0.0,      0.0,    0.0 ),
13834           new NutationModel2(  1,  1,  0,  0,  0,      -3.0,    0.0,      0.0,    0.0 ),
13835           new NutationModel2(  1,  0,  2,  0,  0,       3.0,    0.0,      0.0,    0.0 ),
13836           new NutationModel2(  1, -1,  2,  0,  2,      -3.0,    0.0,      1.0,    0.0 ),
13837           new NutationModel2( -1, -1,  2,  2,  2,      -3.0,    0.0,      1.0,    0.0 ),
13838           new NutationModel2( -2,  0,  0,  0,  1,      -2.0,    0.0,      1.0,    0.0 ),
13839 
13840        /* 71-80 */
13841           new NutationModel2(  3,  0,  2,  0,  2,      -3.0,    0.0,      1.0,    0.0 ),
13842           new NutationModel2(  0, -1,  2,  2,  2,      -3.0,    0.0,      1.0,    0.0 ),
13843           new NutationModel2(  1,  1,  2,  0,  2,       2.0,    0.0,     -1.0,    0.0 ),
13844           new NutationModel2( -1,  0,  2, -2,  1,      -2.0,    0.0,      1.0,    0.0 ),
13845           new NutationModel2(  2,  0,  0,  0,  1,       2.0,    0.0,     -1.0,    0.0 ),
13846           new NutationModel2(  1,  0,  0,  0,  2,      -2.0,    0.0,      1.0,    0.0 ),
13847           new NutationModel2(  3,  0,  0,  0,  0,       2.0,    0.0,      0.0,    0.0 ),
13848           new NutationModel2(  0,  0,  2,  1,  2,       2.0,    0.0,     -1.0,    0.0 ),
13849           new NutationModel2( -1,  0,  0,  0,  2,       1.0,    0.0,     -1.0,    0.0 ),
13850           new NutationModel2(  1,  0,  0, -4,  0,      -1.0,    0.0,      0.0,    0.0 ),
13851 
13852        /* 81-90 */
13853           new NutationModel2( -2,  0,  2,  2,  2,       1.0,    0.0,     -1.0,    0.0 ),
13854           new NutationModel2( -1,  0,  2,  4,  2,      -2.0,    0.0,      1.0,    0.0 ),
13855           new NutationModel2(  2,  0,  0, -4,  0,      -1.0,    0.0,      0.0,    0.0 ),
13856           new NutationModel2(  1,  1,  2, -2,  2,       1.0,    0.0,     -1.0,    0.0 ),
13857           new NutationModel2(  1,  0,  2,  2,  1,      -1.0,    0.0,      1.0,    0.0 ),
13858           new NutationModel2( -2,  0,  2,  4,  2,      -1.0,    0.0,      1.0,    0.0 ),
13859           new NutationModel2( -1,  0,  4,  0,  2,       1.0,    0.0,      0.0,    0.0 ),
13860           new NutationModel2(  1, -1,  0, -2,  0,       1.0,    0.0,      0.0,    0.0 ),
13861           new NutationModel2(  2,  0,  2, -2,  1,       1.0,    0.0,     -1.0,    0.0 ),
13862           new NutationModel2(  2,  0,  2,  2,  2,      -1.0,    0.0,      0.0,    0.0 ),
13863 
13864        /* 91-100 */
13865           new NutationModel2(  1,  0,  0,  2,  1,      -1.0,    0.0,      0.0,    0.0 ),
13866           new NutationModel2(  0,  0,  4, -2,  2,       1.0,    0.0,      0.0,    0.0 ),
13867           new NutationModel2(  3,  0,  2, -2,  2,       1.0,    0.0,      0.0,    0.0 ),
13868           new NutationModel2(  1,  0,  2, -2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13869           new NutationModel2(  0,  1,  2,  0,  1,       1.0,    0.0,      0.0,    0.0 ),
13870           new NutationModel2( -1, -1,  0,  2,  1,       1.0,    0.0,      0.0,    0.0 ),
13871           new NutationModel2(  0,  0, -2,  0,  1,      -1.0,    0.0,      0.0,    0.0 ),
13872           new NutationModel2(  0,  0,  2, -1,  2,      -1.0,    0.0,      0.0,    0.0 ),
13873           new NutationModel2(  0,  1,  0,  2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13874           new NutationModel2(  1,  0, -2, -2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13875 
13876        /* 101-106 */
13877           new NutationModel2(  0, -1,  2,  0,  1,      -1.0,    0.0,      0.0,    0.0 ),
13878           new NutationModel2(  1,  1,  0, -2,  1,      -1.0,    0.0,      0.0,    0.0 ),
13879           new NutationModel2(  1,  0, -2,  2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13880           new NutationModel2(  2,  0,  0,  2,  0,       1.0,    0.0,      0.0,    0.0 ),
13881           new NutationModel2(  0,  0,  2,  4,  2,      -1.0,    0.0,      0.0,    0.0 ),
13882           new NutationModel2(  0,  1,  0,  1,  0,       1.0,    0.0,      0.0,    0.0 )
13883        };
13884 
13885     /* Number of terms in the series */
13886        final int NT = x.length;
13887 
13888     /*--------------------------------------------------------------------*/
13889 
13890     /* Interval between fundamental epoch J2000.0 and given date (JC). */
13891        t = ((date1 - DJ00) + date2) / DJC;
13892 
13893     /* --------------------- */
13894     /* Fundamental arguments */
13895     /* --------------------- */
13896 
13897     /* Mean longitude of Moon minus mean longitude of Moon's perigee. */
13898        el = jauAnpm(
13899             (485866.733 + (715922.633 + (31.310 + 0.064 * t) * t) * t)
13900             * DAS2R + fmod(1325.0 * t, 1.0) * D2PI);
13901 
13902     /* Mean longitude of Sun minus mean longitude of Sun's perigee. */
13903        elp = jauAnpm(
13904              (1287099.804 + (1292581.224 + (-0.577 - 0.012 * t) * t) * t)
13905              * DAS2R + fmod(99.0 * t, 1.0) * D2PI);
13906 
13907     /* Mean longitude of Moon minus mean longitude of Moon's node. */
13908        f = jauAnpm(
13909            (335778.877 + (295263.137 + (-13.257 + 0.011 * t) * t) * t)
13910            * DAS2R + fmod(1342.0 * t, 1.0) * D2PI);
13911 
13912     /* Mean elongation of Moon from Sun. */
13913        d = jauAnpm(
13914            (1072261.307 + (1105601.328 + (-6.891 + 0.019 * t) * t) * t)
13915            * DAS2R + fmod(1236.0 * t, 1.0) * D2PI);
13916 
13917     /* Longitude of the mean ascending node of the lunar orbit on the */
13918     /* ecliptic, measured from the mean equinox of date. */
13919        om = jauAnpm(
13920             (450160.280 + (-482890.539 + (7.455 + 0.008 * t) * t) * t)
13921             * DAS2R + fmod(-5.0 * t, 1.0) * D2PI);
13922 
13923     /* --------------- */
13924     /* Nutation series */
13925     /* --------------- */
13926 
13927     /* Initialize nutation components. */
13928        dp = 0.0;
13929        de = 0.0;
13930 
13931     /* Sum the nutation terms, ending with the biggest. */
13932        for (j = NT-1; j >= 0; j--) {
13933 
13934        /* Form argument for current term. */
13935           arg = (double)x[j].nl  * el
13936               + (double)x[j].nlp * elp
13937               + (double)x[j].nf  * f
13938               + (double)x[j].nd  * d
13939               + (double)x[j].nom * om;
13940 
13941        /* Accumulate current nutation term. */
13942           s = x[j].sp + x[j].spt * t;
13943           c = x[j].ce + x[j].cet * t;
13944           if (s != 0.0) dp += s * sin(arg);
13945           if (c != 0.0) de += c * cos(arg);
13946        }
13947 
13948     /* Convert results from 0.1 mas units to radians. */
13949        return new NutationTerms( dp * U2R,
13950                                  de * U2R);
13951 
13952         }
13953     
13954 
13955     /**
13956     *  Form the matrix of nutation for a given date, IAU 1980 model.
13957     *
13958     *<p>This function is derived from the International Astronomical Union's
13959     *  SOFA (Standards Of Fundamental Astronomy) software collection.
13960     *
13961     *<p>Status:  support function.
13962     *
13963     *<!-- Given: -->
13964     *     @param date1 double           TDB date (Note 1)
13965     *     @param date2 double           TDB date (Note 1) 
13966     *
13967     *<!-- Returned: -->
13968     *     @return           double[3][3]       nutation matrix
13969     *
13970     * <p>Notes:
13971     * <ol>
13972     *
13973     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13974     *     convenient way between the two arguments.  For example,
13975     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13976     *     among others:
13977     *<pre>
13978     *            date1          date2
13979     *
13980     *         2450123.7           0.0       (JD method)
13981     *         2451545.0       -1421.3       (J2000 method)
13982     *         2400000.5       50123.2       (MJD method)
13983     *         2450123.5           0.2       (date &amp; time method)
13984     *</pre>
13985     *     The JD method is the most natural and convenient to use in
13986     *     cases where the loss of several decimal digits of resolution
13987     *     is acceptable.  The J2000 method is best matched to the way
13988     *     the argument is handled internally and will deliver the
13989     *     optimum resolution.  The MJD method and the date &amp; time methods
13990     *     are both good compromises between resolution and convenience.
13991     *
13992     * <li> The matrix operates in the sense V(true) = rmatn * V(mean),
13993     *     where the p-vector V(true) is with respect to the true
13994     *     equatorial triad of date and the p-vector V(mean) is with
13995     *     respect to the mean equatorial triad of date.
13996     *</ol>
13997     *<p>Called:<ul>
13998     *     <li>{@link #jauNut80} nutation, IAU 1980
13999     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
14000     *     <li>{@link #jauNumat} form nutation matrix
14001     * </ul>
14002     *@version 2008 May 12
14003     *
14004     *  @since Release 20101201
14005     *
14006     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14007     */
14008     public static double[][] jauNutm80(double date1, double date2)
14009     {
14010         double rmatn[][];
14011     /* Nutation components and mean obliquity. */
14012        NutationTerms nt = jauNut80(date1, date2);
14013        double epsa = jauObl80(date1, date2);
14014 
14015     /* Build the rotation matrix. */
14016        rmatn = jauNumat(epsa, nt.dpsi, nt.deps);
14017 
14018        return rmatn;
14019 
14020         }
14021     
14022 
14023     /**
14024     *  Mean obliquity of the ecliptic, IAU 2006 precession model.
14025     *
14026     *<p>This function is derived from the International Astronomical Union's
14027     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14028     *
14029     *<p>Status:  canonical model.
14030     *
14031     *<!-- Given: -->
14032     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14033     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14034     *
14035     * <!-- Returned (function value): -->
14036     *  @return double   obliquity of the ecliptic (radians, Note 2)
14037     *
14038     * <p>Notes:
14039     * <ol>
14040     *
14041     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14042     *     convenient way between the two arguments.  For example,
14043     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14044     *     among others:
14045     *<pre>
14046     *            date1          date2
14047     *
14048     *         2450123.7           0.0       (JD method)
14049     *         2451545.0       -1421.3       (J2000 method)
14050     *         2400000.5       50123.2       (MJD method)
14051     *         2450123.5           0.2       (date &amp; time method)
14052     *</pre>
14053     *     The JD method is the most natural and convenient to use in
14054     *     cases where the loss of several decimal digits of resolution
14055     *     is acceptable.  The J2000 method is best matched to the way
14056     *     the argument is handled internally and will deliver the
14057     *     optimum resolution.  The MJD method and the date &amp; time methods
14058     *     are both good compromises between resolution and convenience.
14059     *
14060     * <li> The result is the angle between the ecliptic and mean equator of
14061     *     date date1+date2.
14062     *</ol>
14063     *<p>Reference:
14064     *
14065     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
14066     *
14067     *@version 2009 March 16
14068     *
14069     *  @since Release 20101201
14070     *
14071     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14072     */
14073     public static double jauObl06(double date1, double date2)
14074     {
14075        double t, eps0;
14076 
14077 
14078     /* Interval between fundamental date J2000.0 and given date (JC). */
14079        t = ((date1 - DJ00) + date2) / DJC;
14080 
14081     /* Mean obliquity. */
14082        eps0 = (84381.406     +
14083               (-46.836769    +
14084               ( -0.0001831   +
14085               (  0.00200340  +
14086               ( -0.000000576 +
14087               ( -0.0000000434) * t) * t) * t) * t) * t) * DAS2R;
14088 
14089        return eps0;
14090 
14091         }
14092     
14093 
14094     /**
14095     *  Mean obliquity of the ecliptic, IAU 1980 model.
14096     *
14097     *<p>This function is derived from the International Astronomical Union's
14098     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14099     *
14100     *<p>Status:  canonical model.
14101     *
14102     *<!-- Given: -->
14103     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14104     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14105     *
14106     * <!-- Returned (function value): -->
14107     *  @return double    obliquity of the ecliptic (radians, Note 2)
14108     *
14109     * <p>Notes:
14110     * <ol>
14111     *
14112     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14113     *     convenient way between the two arguments.  For example,
14114     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14115     *     among others:
14116     *<pre>
14117     *            date1          date2
14118     *
14119     *         2450123.7           0.0       (JD method)
14120     *         2451545.0       -1421.3       (J2000 method)
14121     *         2400000.5       50123.2       (MJD method)
14122     *         2450123.5           0.2       (date &amp; time method)
14123     *</pre>
14124     *     The JD method is the most natural and convenient to use in
14125     *     cases where the loss of several decimal digits of resolution
14126     *     is acceptable.  The J2000 method is best matched to the way
14127     *     the argument is handled internally and will deliver the
14128     *     optimum resolution.  The MJD method and the date &amp; time methods
14129     *     are both good compromises between resolution and convenience.
14130     *
14131     * <li> The result is the angle between the ecliptic and mean equator of
14132     *     date date1+date2.
14133     *</ol>
14134     *<p>Reference:
14135     *
14136     *     <p>Explanatory Supplement to the Astronomical Almanac,
14137     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
14138     *     Expression 3.222-1 (p114).
14139     *
14140     *@version 2009 March 16
14141     *
14142     *  @since Release 20101201
14143     *
14144     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14145     */
14146     public static double jauObl80(double date1, double date2)
14147     {
14148        double t, eps0;
14149 
14150 
14151     /* Interval between fundamental epoch J2000.0 and given date (JC). */
14152        t = ((date1 - DJ00) + date2) / DJC;
14153 
14154     /* Mean obliquity of date. */
14155        eps0 = DAS2R * (84381.448  +
14156                       (-46.8150   +
14157                       (-0.00059   +
14158                       ( 0.001813) * t) * t) * t);
14159 
14160        return eps0;
14161 
14162         }
14163     
14164     
14165     /**
14166      * equinox based precession angles.
14167      *  .
14168      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 21 Nov 2011
14169      * @version $Revision$ $date$
14170      */
14171     public static class PrecessionAngles {
14172         /** epsilon_0   obliquity at J2000.0. */
14173         public double eps0; 
14174         /** psi_A       luni-solar precession. */
14175         public double psia;
14176         /** omega_A     inclination of equator wrt J2000.0 ecliptic. */
14177         public  double oma;
14178         /** P_A         ecliptic pole x, J2000.0 ecliptic triad. */
14179         public  double bpa;
14180         /** Q_A         ecliptic pole -y, J2000.0 ecliptic triad. */
14181         public double bqa;
14182         /** pi_A        angle between moving and J2000.0 ecliptics. */
14183         public  double pia;
14184         /** Pi_A        longitude of ascending node of the ecliptic. */
14185         public  double bpia;
14186         /** epsilon_A   obliquity of the ecliptic. */
14187         public double epsa;
14188         /** chi_A       planetary precession. */
14189         public  double chia;
14190         /** z_A         equatorial precession: -3rd 323 Euler angle. */
14191         public  double za;
14192         /** zeta_A      equatorial precession: -1st 323 Euler angle. */
14193         public  double zetaa;
14194         /** theta_A     equatorial precession: 2nd 323 Euler angle. */
14195         public double thetaa;
14196         /** p_A         general precession. */
14197         public  double pa;
14198         /** gamma_J2000 J2000.0 RA difference of ecliptic poles. */
14199         public  double gam;
14200         /** phi_J2000   J2000.0 codeclination of ecliptic pole. */
14201         public  double phi;
14202         /** psi_J2000   longitude difference of equator poles, J2000.0. */
14203         public  double psi;
14204 
14205         public PrecessionAngles ( double eps0, double psia, double oma, double bpa,
14206                  double bqa, double pia, double bpia,
14207                  double epsa, double chia, double za, double zetaa,
14208                  double thetaa, double pa,
14209                  double gam, double phi, double psi){
14210             
14211             this.eps0 = eps0;
14212             this.psia = psia;
14213             this.oma = oma;
14214             this.bpa = bpa;
14215             this.bqa = bqa;
14216             this.pia = pia;
14217             this.bpia = bpia;
14218             this.epsa = epsa;
14219             this.chia = chia;
14220             this.za = za;
14221             this.zetaa = zetaa;
14222             this.thetaa = thetaa;
14223             this.pa = pa;
14224             this.gam = gam;
14225             this.phi = phi;
14226             this.psi = psi;
14227         }
14228     }
14229     /**
14230     *  Precession angles, IAU 2006, equinox based.
14231     *
14232     *<p>This function is derived from the International Astronomical Union's
14233     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14234     *
14235     *<p>Status:  canonical models.
14236     *
14237     *<!-- Given: -->
14238     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14239     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14240     *
14241     *  @return (see Note 2):
14242     *     eps0          double   epsilon_0
14243     *     psia          double   psi_A
14244     *     oma           double   omega_A
14245     *     bpa           double   P_A
14246     *     bqa           double   Q_A
14247     *     pia           double   pi_A
14248     *     bpia          double   Pi_A
14249     *     epsa          double   obliquity epsilon_A
14250     *     chia          double   chi_A
14251     *     za            double   z_A
14252     *     zetaa         double   zeta_A
14253     *     thetaa        double   theta_A
14254     *     pa            double   p_A
14255     *     gam           double   F-W angle gamma_J2000
14256     *     phi           double   F-W angle phi_J2000
14257     *     psi           double   F-W angle psi_J2000
14258     *
14259     * <p>Notes:
14260     * <ol>
14261     *
14262     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14263     *     convenient way between the two arguments.  For example,
14264     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14265     *     among others:
14266     *<pre>
14267     *            date1          date2
14268     *
14269     *         2450123.7           0.0       (JD method)
14270     *         2451545.0       -1421.3       (J2000 method)
14271     *         2400000.5       50123.2       (MJD method)
14272     *         2450123.5           0.2       (date &amp; time method)
14273     *</pre>
14274     *     The JD method is the most natural and convenient to use in
14275     *     cases where the loss of several decimal digits of resolution
14276     *     is acceptable.  The J2000 method is best matched to the way
14277     *     the argument is handled internally and will deliver the
14278     *     optimum resolution.  The MJD method and the date &amp; time methods
14279     *     are both good compromises between resolution and convenience.
14280     *
14281     * <li> This function returns the set of equinox based angles for the
14282     *     Capitaine et al. "P03" precession theory, adopted by the IAU in
14283     *     2006.  The angles are set out in Table 1 of Hilton et al. (2006):
14284     *
14285     *     eps0   epsilon_0   obliquity at J2000.0
14286     *     psia   psi_A       luni-solar precession
14287     *     oma    omega_A     inclination of equator wrt J2000.0 ecliptic
14288     *     bpa    P_A         ecliptic pole x, J2000.0 ecliptic triad
14289     *     bqa    Q_A         ecliptic pole -y, J2000.0 ecliptic triad
14290     *     pia    pi_A        angle between moving and J2000.0 ecliptics
14291     *     bpia   Pi_A        longitude of ascending node of the ecliptic
14292     *     epsa   epsilon_A   obliquity of the ecliptic
14293     *     chia   chi_A       planetary precession
14294     *     za     z_A         equatorial precession: -3rd 323 Euler angle
14295     *     zetaa  zeta_A      equatorial precession: -1st 323 Euler angle
14296     *     thetaa theta_A     equatorial precession: 2nd 323 Euler angle
14297     *     pa     p_A         general precession (see note below)
14298     *     gam    gamma_J2000 J2000.0 RA difference of ecliptic poles
14299     *     phi    phi_J2000   J2000.0 codeclination of ecliptic pole
14300     *     psi    psi_J2000   longitude difference of equator poles, J2000.0
14301     *
14302     *     The returned values are all radians.
14303     *     
14304     *  <li>Note that the t^5 coefficient in the series for p_A from
14305     *   Capitaine et al. (2003) is incorrectly signed in Hilton et al. (2006).
14306     *
14307     * <li> Hilton et al. (2006) Table 1 also contains angles that depend on
14308     *     models distinct from the P03 precession theory itself, namely the
14309     *     IAU 2000A frame bias and nutation.  The quoted polynomials are
14310     *     used in other JSOFA functions:
14311     *
14312     *     . jauXy06  contains the polynomial parts of the X and Y series.
14313     *
14314     *     . jauS06  contains the polynomial part of the s+XY/2 series.
14315     *
14316     *     . jauPfw06  implements the series for the Fukushima-Williams
14317     *       angles that are with respect to the GCRS pole (i.e. the variants
14318     *       that include frame bias).
14319     *
14320     * <li> The IAU resolution stipulated that the choice of parameterization
14321     *     was left to the user, and so an IAU compliant precession
14322     *     implementation can be constructed using various combinations of
14323     *     the angles returned by the present function.
14324     *
14325     * <li> The parameterization used by JSOFA is the Fukushima-Williams angles
14326     *     referred directly to the GCRS pole.  These are the final four
14327     *     arguments returned by the present function, but are more
14328     *     efficiently calculated by calling the function jauPfw06.   JSOFA
14329     *     also supports the direct computation of the CIP GCRS X,Y by
14330     *     series, available by calling jauXy06.
14331     *
14332     * <li> The agreement between the different parameterizations is at the
14333     *     1 microarcsecond level in the present era.
14334     *
14335     * <li> When constructing a precession formulation that refers to the GCRS
14336     *     pole rather than the dynamical pole, it may (depending on the
14337     *     choice of angles) be necessary to introduce the frame bias
14338     *     explicitly.
14339     *
14340     * <li> It is permissible to re-use the same variable in the returned
14341     *     arguments.  The quantities are stored in the stated order.
14342     *</ol>
14343     *<p>References:<ol>
14344     *   <li> Capitaine, N., Wallace, P.T. &amp; Chapront, J., 2003, Astron.Astrophys., 412, 567
14345     *   <li> Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
14346     *</ol>
14347     *<p>Called:<ul>
14348     *     <li>{@link #jauObl06} mean obliquity, IAU 2006
14349     * </ul>
14350     *@version 2020 Nov 13
14351     *
14352     *  @since Release 20101201
14353     *
14354     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14355     */
14356     public static PrecessionAngles jauP06e(double date1, double date2)
14357     {
14358        double t;
14359        double eps0,  psia,  oma,  bpa,
14360         bqa,  pia,  bpia,
14361         epsa,  chia,  za,  zetaa,
14362         thetaa,  pa,
14363         gam,  phi,  psi;
14364 
14365     /* Interval between fundamental date J2000.0 and given date (JC). */
14366        t = ((date1 - DJ00) + date2) / DJC;
14367 
14368     /* Obliquity at J2000.0. */
14369 
14370        eps0 = 84381.406 * DAS2R;
14371 
14372     /* Luni-solar precession. */
14373 
14374        psia = ( 5038.481507     +
14375                (   -1.0790069    +
14376                (   -0.00114045   +
14377                (    0.000132851  +
14378                (   -0.0000000951 )
14379                * t) * t) * t) * t) * t * DAS2R;
14380 
14381     /* Inclination of mean equator with respect to the J2000.0 ecliptic. */
14382 
14383        oma = eps0 + ( -0.025754     +
14384                       (  0.0512623    +
14385                       ( -0.00772503   +
14386                       ( -0.000000467  +
14387                       (  0.0000003337 )
14388                       * t) * t) * t) * t) * t * DAS2R;
14389 
14390     /* Ecliptic pole x, J2000.0 ecliptic triad. */
14391 
14392        bpa = (  4.199094     +
14393               (  0.1939873    +
14394               ( -0.00022466   +
14395               ( -0.000000912  +
14396               (  0.0000000120 )
14397               * t) * t) * t) * t) * t * DAS2R;
14398 
14399     /* Ecliptic pole -y, J2000.0 ecliptic triad. */
14400 
14401        bqa = ( -46.811015     +
14402               (   0.0510283    +
14403               (   0.00052413   +
14404               (  -0.000000646  +
14405               (  -0.0000000172 )
14406               * t) * t) * t) * t) * t * DAS2R;
14407 
14408     /* Angle between moving and J2000.0 ecliptics. */
14409 
14410        pia = ( 46.998973     +
14411               ( -0.0334926    +
14412               ( -0.00012559   +
14413               (  0.000000113  +
14414               ( -0.0000000022 )
14415               * t) * t) * t) * t) * t * DAS2R;
14416 
14417     /* Longitude of ascending node of the moving ecliptic. */
14418 
14419        bpia = ( 629546.7936      +
14420                (   -867.95758     +
14421                (      0.157992    +
14422                (     -0.0005371   +
14423                (     -0.00004797  +
14424                (      0.000000072 )
14425                * t) * t) * t) * t) * t) * DAS2R;
14426 
14427     /* Mean obliquity of the ecliptic. */
14428 
14429        epsa = jauObl06(date1, date2);
14430 
14431     /* Planetary precession. */
14432 
14433        chia = ( 10.556403     +
14434                ( -2.3814292    +
14435                ( -0.00121197   +
14436                (  0.000170663  +
14437                ( -0.0000000560 )
14438                * t) * t) * t) * t) * t * DAS2R;
14439 
14440     /* Equatorial precession: minus the third of the 323 Euler angles. */
14441 
14442        za = (   -2.650545     +
14443              ( 2306.077181     +
14444              (    1.0927348    +
14445              (    0.01826837   +
14446              (   -0.000028596  +
14447              (   -0.0000002904 )
14448              * t) * t) * t) * t) * t) * DAS2R;
14449 
14450     /* Equatorial precession: minus the first of the 323 Euler angles. */
14451 
14452        zetaa = (    2.650545     +
14453                 ( 2306.083227     +
14454                 (    0.2988499    +
14455                 (    0.01801828   +
14456                 (   -0.000005971  +
14457                 (   -0.0000003173 )
14458                 * t) * t) * t) * t) * t) * DAS2R;
14459 
14460     /* Equatorial precession: second of the 323 Euler angles. */
14461 
14462        thetaa = ( 2004.191903     +
14463                  (   -0.4294934    +
14464                  (   -0.04182264   +
14465                  (   -0.000007089  +
14466                  (   -0.0000001274 )
14467                  * t) * t) * t) * t) * t * DAS2R;
14468 
14469     /* General precession. */
14470 
14471        pa = ( 5028.796195     +
14472              (    1.1054348    +
14473              (    0.00007964   +
14474              (   -0.000023857  +
14475              (   -0.0000000383 )
14476              * t) * t) * t) * t) * t * DAS2R;
14477 
14478     /* Fukushima-Williams angles for precession. */
14479 
14480        gam = ( 10.556403     +
14481               (  0.4932044    +
14482               ( -0.00031238   +
14483               ( -0.000002788  +
14484               (  0.0000000260 )
14485               * t) * t) * t) * t) * t * DAS2R;
14486 
14487        phi = eps0 + ( -46.811015     +
14488                       (   0.0511269    +
14489                       (   0.00053289   +
14490                       (  -0.000000440  +
14491                       (  -0.0000000176 )
14492                       * t) * t) * t) * t) * t * DAS2R;
14493 
14494        psi = ( 5038.481507     +
14495               (    1.5584176    +
14496               (   -0.00018522   +
14497               (   -0.000026452  +
14498               (   -0.0000000148 )
14499               * t) * t) * t) * t) * t * DAS2R;
14500 
14501        return new PrecessionAngles(eps0, psia, oma, bpa, bqa, pia, bpia, epsa, chia, za, zetaa, thetaa, pa, gam, phi, psi);
14502 
14503         }
14504     
14505 
14506     /**
14507     *  Extend a p-vector to a pv-vector by appending a zero velocity.
14508     *
14509     *<p>This function is derived from the International Astronomical Union's
14510     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14511     *
14512     *<p>Status:  vector/matrix support function.
14513     *
14514     *<!-- Given: -->
14515     *     @param p         double[3]        p-vector
14516     *
14517     *<!-- Returned: -->
14518     *     @return pv        double[2][3]      <u>returned</u> pv-vector
14519     *
14520     *<p>Called:<ul>
14521     *     <li>{@link #jauCp} copy p-vector
14522     *     <li>{@link #jauZp} zero p-vector
14523     * </ul>
14524     *@version 2008 May 11
14525     *
14526     *  @since Release 20101201
14527     *
14528     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14529     */
14530     public static double[][] jauP2pv(double p[] )
14531     {
14532         double pv[][] = new double[3][3];
14533         jauCp(p, pv[0]);
14534         jauZp(pv[1]);
14535 
14536         return pv;
14537 
14538         }
14539     
14540     /**
14541      * A position expressed in spherical polar coordinates.
14542      *  .
14543      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 21 Nov 2011
14544      * @version $Revision$ $date$
14545      */
14546     public static class SphericalPosition {
14547         /** longitude angle (radians) */
14548         public double theta;
14549         /** latitude angle (radians) */
14550         public double phi;
14551         /** radial distance */
14552         public double r;
14553         public SphericalPosition(double theta, double phi, double r) {
14554            this.theta = theta;
14555            this.phi = phi;
14556            this.r = r;
14557         }
14558     }
14559     
14560     /**
14561     *  P-vector to spherical polar coordinates.
14562     *
14563     *<p>This function is derived from the International Astronomical Union's
14564     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14565     *
14566     *<p>Status:  vector/matrix support function.
14567     *
14568     *<!-- Given: -->
14569     *     @param p         double[3]     p-vector
14570     *
14571     *<!-- Returned: -->
14572     *     @return theta     double         <u>returned</u> longitude angle (radians)
14573     *             phi       double         <u>returned</u> latitude angle (radians)
14574     *             r         double         <u>returned</u> radial distance
14575     *
14576     * <p>Notes:
14577     * <ol>
14578     *
14579     * <li> If P is null, zero theta, phi and r are returned.
14580     *
14581     * <li> At either pole, zero theta is returned.
14582     *</ol>
14583     *<p>Called:<ul>
14584     *     <li>{@link #jauC2s} p-vector to spherical
14585     *     <li>{@link #jauPm} modulus of p-vector
14586     * </ul>
14587     *@version 2008 May 22
14588     *
14589     *  @since Release 20101201
14590     *
14591     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14592     */
14593     public static SphericalPosition jauP2s(double p[])
14594     {
14595        SphericalCoordinate sc = jauC2s(p);
14596        double r = jauPm(p);
14597 
14598        return new SphericalPosition(sc.alpha, sc.delta, r);
14599 
14600         }
14601     
14602 
14603     /**
14604     *  Position-angle from two p-vectors.
14605     *
14606     *<p>This function is derived from the International Astronomical Union's
14607     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14608     *
14609     *<p>Status:  vector/matrix support function.
14610     *
14611     *<!-- Given: -->
14612     *     @param a       double[3]   direction of reference point
14613     *     @param b       double[3]   direction of point whose PA is required
14614     *
14615     * <!-- Returned (function value): -->
14616     *  @return double     position angle of b with respect to a (radians)
14617     *
14618     * <p>Notes:
14619     * <ol>
14620     *
14621     * <li> The result is the position angle, in radians, of direction b with
14622     *     respect to direction a.  It is in the range -pi to +pi.  The
14623     *     sense is such that if b is a small distance "north" of a the
14624     *     position angle is approximately zero, and if b is a small
14625     *     distance "east" of a the position angle is approximately +pi/2.
14626     *
14627     * <li> The vectors a and b need not be of unit length.
14628     *
14629     * <li> Zero is returned if the two directions are the same or if either
14630     *     vector is null.
14631     *
14632     * <li> If vector a is at a pole, the result is ill-defined.
14633     *</ol>
14634     *<p>Called:<ul>
14635     *     <li>{@link #jauPn} decompose p-vector into modulus and direction
14636     *     <li>{@link #jauPm} modulus of p-vector
14637     *     <li>{@link #jauPxp} vector product of two p-vectors
14638     *     <li>{@link #jauPmp} p-vector minus p-vector
14639     *     <li>{@link #jauPdp} scalar product of two p-vectors
14640     * </ul>
14641     *@version 2008 May 25
14642     *
14643     *  @since Release 20101201
14644     *
14645     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14646     */
14647     public static double jauPap(double a[] , double b[] )
14648     {
14649        double am, au[] = new double[3], bm, st, ct, xa, ya, za, eta[] = new double[3], xi[] = new double[3], a2b[] = new double[3], pa;
14650 
14651 
14652     /* Modulus and direction of the a vector. */
14653        NormalizedVector nv = jauPn(a );
14654        am = nv.r; au = nv.u;
14655     /* Modulus of the b vector. */
14656        bm = jauPm(b);
14657 
14658     /* Deal with the case of a null vector. */
14659        if ((am == 0.0) || (bm == 0.0)) {
14660           st = 0.0;
14661           ct = 1.0;
14662        } else {
14663 
14664        /* The "north" axis tangential from a (arbitrary length). */
14665           xa = a[0];
14666           ya = a[1];
14667           za = a[2];
14668           eta[0] = -xa * za;
14669           eta[1] = -ya * za;
14670           eta[2] =  xa*xa + ya*ya;
14671 
14672        /* The "east" axis tangential from a (same length). */
14673           xi = jauPxp(eta,au);
14674 
14675        /* The vector from a to b. */
14676           a2b = jauPmp(b, a);
14677 
14678        /* Resolve into components along the north and east axes. */
14679           st = jauPdp(a2b, xi);
14680           ct = jauPdp(a2b, eta);
14681 
14682        /* Deal with degenerate cases. */
14683           if ((st == 0.0) && (ct == 0.0)) ct = 1.0;
14684        }
14685 
14686     /* Position angle. */
14687        pa = atan2(st, ct);
14688 
14689        return pa;
14690 
14691         }
14692     
14693 
14694     /**
14695     *  Position-angle from spherical coordinates.
14696     *
14697     *<p>This function is derived from the International Astronomical Union's
14698     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14699     *
14700     *<p>Status:  vector/matrix support function.
14701     *
14702     *<!-- Given: -->
14703     *     @param al      double      longitude of point A (e.g. RA) in radians
14704     *     @param ap      double      latitude of point A (e.g. Dec) in radians
14705     *     @param bl      double      longitude of point B
14706     *     @param bp      double      latitude of point B
14707     *
14708     * <!-- Returned (function value): -->
14709     *  @return double     position angle of B with respect to A
14710     *
14711     * <p>Notes:
14712     * <ol>
14713     *
14714     * <li> The result is the bearing (position angle), in radians, of point
14715     *     B with respect to point A.  It is in the range -pi to +pi.  The
14716     *     sense is such that if B is a small distance "east" of point A,
14717     *     the bearing is approximately +pi/2.
14718     *
14719     * <li> Zero is returned if the two points are coincident.
14720     *</ol>
14721     *@version 2008 May 22
14722     *
14723     *  @since Release 20101201
14724     *
14725     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14726     */
14727     public static double jauPas(double al, double ap, double bl, double bp)
14728     {
14729        double dl, x, y, pa;
14730 
14731 
14732        dl = bl - al;
14733        y = sin(dl) * cos(bp);
14734        x = sin(bp) * cos(ap) - cos(bp) * sin(ap) * cos(dl);
14735        pa = ((x != 0.0) || (y != 0.0)) ? atan2(y, x) : 0.0;
14736 
14737        return pa;
14738 
14739         }
14740     
14741 
14742     /**
14743     *  This function forms three Euler angles which implement general
14744     *  precession from epoch J2000.0, using the IAU 2006 model.  Frame
14745     *  bias (the offset between ICRS and mean J2000.0) is included.
14746     *
14747     *<p>This function is derived from the International Astronomical Union's
14748     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14749     *
14750     *<p>Status:  support function.
14751     *
14752     *<!-- Given: -->
14753     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14754     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14755     *
14756     *<!-- Returned: -->
14757     *     @return bzeta          1st rotation: radians cw around z,
14758     *                            3rd rotation: radians cw around z,
14759     *                            2nd rotation: radians ccw around y.
14760     *
14761     * <p>Notes:
14762     * <ol>
14763     *
14764     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14765     *     convenient way between the two arguments.  For example,
14766     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14767     *     among others:
14768     *<pre>
14769     *            date1          date2
14770     *
14771     *         2450123.7           0.0       (JD method)
14772     *         2451545.0       -1421.3       (J2000 method)
14773     *         2400000.5       50123.2       (MJD method)
14774     *         2450123.5           0.2       (date &amp; time method)
14775     *</pre>
14776     *     The JD method is the most natural and convenient to use in
14777     *     cases where the loss of several decimal digits of resolution
14778     *     is acceptable.  The J2000 method is best matched to the way
14779     *     the argument is handled internally and will deliver the
14780     *     optimum resolution.  The MJD method and the date &amp; time methods
14781     *     are both good compromises between resolution and convenience.
14782     *
14783     * <li> The traditional accumulated precession angles zeta_A, z_A,
14784     *     theta_A cannot be obtained in the usual way, namely through
14785     *     polynomial expressions, because of the frame bias.  The latter
14786     *     means that two of the angles undergo rapid changes near this
14787     *     date.  They are instead the results of decomposing the
14788     *     precession-bias matrix obtained by using the Fukushima-Williams
14789     *     method, which does not suffer from the problem.  The
14790     *     decomposition returns values which can be used in the
14791     *     conventional formulation and which include frame bias.
14792     *
14793     * <li> The three angles are returned in the conventional order, which
14794     *     is not the same as the order of the corresponding Euler
14795     *     rotations.  The precession-bias matrix is
14796     *     R_3(-z) x R_2(+theta) x R_3(-zeta).
14797     *
14798     * <li> Should zeta_A, z_A, theta_A angles be required that do not
14799     *     contain frame bias, they are available by calling the JSOFA
14800     *     function jauP06e.
14801     *</ol>
14802     *<p>Called:<ul>
14803     *     <li>{@link #jauPmat06} PB matrix, IAU 2006
14804     *     <li>{@link #jauRz} rotate around Z-axis
14805     * </ul>
14806     *@version 2008 May 26
14807     *
14808     *  @since Release 20101201
14809     *
14810     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14811     */
14812     public static EulerAngles jauPb06(double date1, double date2)
14813     {
14814         double r[][] = new double[3][3], y, x;
14815 
14816 
14817         /* Precession matrix via Fukushima-Williams angles. */
14818         r = jauPmat06(date1, date2);
14819 
14820         /* Solve for z, choosing the +/- pi alternative. */
14821         y = r[1][2];
14822         x = -r[0][2];
14823         if ( x < 0.0 ) {
14824             y = -y;
14825             x = -x;
14826         }
14827         double bz = ( x != 0.0 || y != 0.0 ) ? - atan2(y,x) : 0.0;
14828 
14829         /* Derotate it out of the matrix. */
14830         jauRz ( bz, r );
14831 
14832         /* Solve for the remaining two angles. */
14833         y = r[0][2];
14834         x = r[2][2];
14835         double btheta = ( x != 0.0 || y != 0.0 ) ? - atan2(y,x) : 0.0;
14836 
14837         y = -r[1][0];
14838         x = r[1][1];
14839         double bzeta = ( x != 0.0 || y != 0.0 ) ? - atan2(y,x) : 0.0;
14840 
14841         return new EulerAngles(bzeta, bz, btheta);
14842 
14843     }
14844 
14845 
14846     /**
14847     *  p-vector inner (=scalar=dot) product.
14848     *
14849     *<p>This function is derived from the International Astronomical Union's
14850     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14851     *
14852     *<p>Status:  vector/matrix support function.
14853     *
14854     *<!-- Given: -->
14855     *     @param a       double[3]      first p-vector
14856     *     @param b       double[3]      second p-vector
14857     *
14858     * <!-- Returned (function value): -->
14859     *  @return double        a . b
14860     *
14861     *@version 2008 May 22
14862     *
14863     *  @since Release 20101201
14864     *
14865     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14866     */
14867     public static double jauPdp(double a[] , double b[] )
14868     {
14869        double w;
14870 
14871 
14872        w  = a[0] * b[0]
14873           + a[1] * b[1]
14874           + a[2] * b[2];
14875 
14876        return w;
14877 
14878         }
14879     
14880 
14881     /**
14882      * Precession angles, IAU 2006 (Fukushima-Williams 4-angle formulation).
14883      * 
14884      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
14885      * 
14886      * @since AIDA Stage 1
14887      */
14888     public static class FWPrecessionAngles{
14889         /** F-W angle gamma_bar (radians) */
14890         public double gamb;
14891         /** F-W angle phi_bar (radians) */
14892         public double phib;
14893         /** F-W angle psi_bar (radians) */
14894         public double psib;
14895         /** F-W angle epsilon_A (radians) */
14896         public double epsa;
14897         public FWPrecessionAngles(double gamb, double phib, double psib, double epsa) {
14898             this.gamb = gamb;
14899             this.phib = phib;
14900             this.psib = psib;
14901             this.epsa = epsa;
14902         }
14903     }
14904     /**
14905     *  Precession angles, IAU 2006 (Fukushima-Williams 4-angle formulation).
14906     *
14907     *<p>This function is derived from the International Astronomical Union's
14908     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14909     *
14910     *<p>Status:  canonical model.
14911     *
14912     *<!-- Given: -->
14913     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14914     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14915     *
14916     *<!-- Returned: -->
14917     *     @return gamb          double     <u>returned</u> F-W angle gamma_bar (radians)
14918     *             phib          double     <u>returned</u> F-W angle phi_bar (radians)
14919     *             psib          double     <u>returned</u> F-W angle psi_bar (radians)
14920     *             epsa          double     <u>returned</u> F-W angle epsilon_A (radians)
14921     *
14922     * <p>Notes:
14923     * <ol>
14924     *
14925     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14926     *     convenient way between the two arguments.  For example,
14927     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14928     *     among others:
14929     *<pre>
14930     *            date1          date2
14931     *
14932     *         2450123.7           0.0       (JD method)
14933     *         2451545.0       -1421.3       (J2000 method)
14934     *         2400000.5       50123.2       (MJD method)
14935     *         2450123.5           0.2       (date &amp; time method)
14936     *</pre>
14937     *     The JD method is the most natural and convenient to use in
14938     *     cases where the loss of several decimal digits of resolution
14939     *     is acceptable.  The J2000 method is best matched to the way
14940     *     the argument is handled internally and will deliver the
14941     *     optimum resolution.  The MJD method and the date &amp; time methods
14942     *     are both good compromises between resolution and convenience.
14943     *
14944     * <li> Naming the following points:
14945     *
14946     *           e = J2000.0 ecliptic pole,
14947     *           p = GCRS pole,
14948     *           E = mean ecliptic pole of date,
14949     *     and   P = mean pole of date,
14950     *
14951     *     the four Fukushima-Williams angles are as follows:
14952     *
14953     *        gamb = gamma_bar = epE
14954     *        phib = phi_bar = pE
14955     *        psib = psi_bar = pEP
14956     *        epsa = epsilon_A = EP
14957     *
14958     * <li> The matrix representing the combined effects of frame bias and
14959     *     precession is:
14960     *
14961     *        PxB = R_1(-epsa).R_3(-psib).R_1(phib).R_3(gamb)
14962     *
14963     * <li> The matrix representing the combined effects of frame bias,
14964     *     precession and nutation is simply:
14965     *
14966     *        NxPxB = R_1(-epsa-dE).R_3(-psib-dP).R_1(phib).R_3(gamb)
14967     *
14968     *     where dP and dE are the nutation components with respect to the
14969     *     ecliptic of date.
14970     *</ol>
14971     *<p>Reference:
14972     *
14973     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
14974     *
14975     *<p>Called:<ul>
14976     *     <li>{@link #jauObl06} mean obliquity, IAU 2006
14977     * </ul>
14978     *@version 2009 December 17
14979     *
14980     *  @since Release 20101201
14981     *
14982     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14983     */
14984     public static FWPrecessionAngles jauPfw06(double date1, double date2 )
14985     {
14986        double t;
14987 
14988 
14989     /* Interval between fundamental date J2000.0 and given date (JC). */
14990        t = ((date1 - DJ00) + date2) / DJC;
14991 
14992     /* P03 bias+precession angles. */
14993        double gamb = (    -0.052928     +
14994                (    10.556378     +
14995                (     0.4932044    +
14996                (    -0.00031238   +
14997                (    -0.000002788  +
14998                (     0.0000000260 )
14999                * t) * t) * t) * t) * t) * DAS2R;
15000        double phib = ( 84381.412819     +
15001                (   -46.811016     +
15002                (     0.0511268    +
15003                (     0.00053289   +
15004                (    -0.000000440  +
15005                (    -0.0000000176 )
15006                * t) * t) * t) * t) * t) * DAS2R;
15007        double psib = (    -0.041775     +
15008                (  5038.481484     +
15009                (     1.5584175    +
15010                (    -0.00018522   +
15011                (    -0.000026452  +
15012                (    -0.0000000148 )
15013                * t) * t) * t) * t) * t) * DAS2R;
15014        double epsa =  jauObl06(date1, date2);
15015 
15016        return new FWPrecessionAngles(gamb, phib, psib, epsa);
15017 
15018         }
15019     
15020 
15021     /**
15022     *
15023     *  Approximate heliocentric position and velocity of a nominated major
15024     *  planet:  Mercury, Venus, EMB, Mars, Jupiter, Saturn, Uranus or
15025     *  Neptune (but not the Earth itself).
15026     *  
15027     *  n.b. Not IAU-endorsed and without canonical status.
15028     *  
15029     *<p>This function is derived from the International Astronomical Union's
15030     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15031     *
15032     *<p>Status:  support function.
15033     *
15034     *<!-- Given: -->
15035     *     @param date1   double        TDB date part A (Note 1)
15036     *     @param date2   double        TDB date part B (Note 1)
15037     *     @param np      int           planet (1=Mercury, 2=Venus, 3=EMB, 4=Mars,
15038     *                                  5=Jupiter,  6=Saturn,  7=Uranus, 8=Neptune)
15039     *
15040     *  Returned (argument):
15041     *     @return  pv     double[2][3] (returned) planet p,v (heliocentric, J2000.0, au,au/d)
15042     *
15043     *
15044     * <p>Notes:
15045     * <ol>
15046     *
15047     * <li> The date date1+date2 is in the TDB time scale (in practice TT can
15048     *     be used) and is a Julian Date, apportioned in any convenient way
15049     *     between the two arguments.  For example, JD(TDB)=2450123.7 could
15050     *     be expressed in any of these ways, among others:
15051     *<pre>
15052     *            date1          date2
15053     *
15054     *         2450123.7           0.0       (JD method)
15055     *         2451545.0       -1421.3       (J2000 method)
15056     *         2400000.5       50123.2       (MJD method)
15057     *         2450123.5           0.2       (date &amp; time method)
15058     *</pre>
15059     *     The JD method is the most natural and convenient to use in cases
15060     *     where the loss of several decimal digits of resolution is
15061     *     acceptable.  The J2000 method is best matched to the way the
15062     *     argument is handled internally and will deliver the optimum
15063     *     resolution.  The MJD method and the date &amp; time methods are both
15064     *     good compromises between resolution and convenience.  The limited
15065     *     accuracy of the present algorithm is such that any of the methods
15066     *     is satisfactory.
15067     *
15068     * <li> If an np value outside the range 1-8 is supplied, an exception is thrown.
15069     *
15070     * <li> For np=3 the result is for the Earth-Moon Barycenter.  To obtain
15071     *     the heliocentric position and velocity of the Earth, use instead
15072     *     the JSOFA function jauEpv00.
15073     *
15074     * <li> On successful return, the array pv contains the following:
15075     *<pre>
15076     *        pv[0][0]   x      }
15077     *        pv[0][1]   y      } heliocentric position, au
15078     *        pv[0][2]   z      }
15079     *
15080     *        pv[1][0]   xdot   }
15081     *        pv[1][1]   ydot   } heliocentric velocity, au/d
15082     *        pv[1][2]   zdot   }
15083     *</pre>
15084     *     The reference frame is equatorial and is with respect to the
15085     *     mean equator and equinox of epoch J2000.0.
15086     *
15087     * <li> The algorithm is due to J.L. Simon, P. Bretagnon, J. Chapront,
15088     *     M. Chapront-Touze, G. Francou and J. Laskar (Bureau des
15089     *     Longitudes, Paris, France).  From comparisons with JPL
15090     *     ephemeris DE102, they quote the following maximum errors
15091     *     over the interval 1800-2050:
15092     *<pre>
15093     *                     L (arcsec)    B (arcsec)      R (km)
15094     *
15095     *        Mercury          4             1             300
15096     *        Venus            5             1             800
15097     *        EMB              6             1            1000
15098     *        Mars            17             1            7700
15099     *        Jupiter         71             5           76000
15100     *        Saturn          81            13          267000
15101     *        Uranus          86             7          712000
15102     *        Neptune         11             1          253000
15103     *</pre>
15104     *     Over the interval 1000-3000, they report that the accuracy is no
15105     *     worse than 1.5 times that over 1800-2050.  Outside 1000-3000 the
15106     *     accuracy declines.
15107     *
15108     *     Comparisons of the present function with the JPL DE200 ephemeris
15109     *     give the following RMS errors over the interval 1960-2025:
15110     *<pre>
15111     *                      position (km)     velocity (m/s)
15112     *
15113     *        Mercury            334               0.437
15114     *        Venus             1060               0.855
15115     *        EMB               2010               0.815
15116     *        Mars              7690               1.98
15117     *        Jupiter          71700               7.70
15118     *        Saturn          199000              19.4
15119     *        Uranus          564000              16.4
15120     *        Neptune         158000              14.4
15121     *</pre>
15122     *     Comparisons against DE200 over the interval 1800-2100 gave the
15123     *     following maximum absolute differences.  (The results using
15124     *     DE406 were essentially the same.)
15125     *<pre>
15126     *                   L (arcsec)   B (arcsec)     R (km)   Rdot (m/s)
15127     *
15128     *        Mercury        7            1            500       0.7
15129     *        Venus          7            1           1100       0.9
15130     *        EMB            9            1           1300       1.0
15131     *        Mars          26            1           9000       2.5
15132     *        Jupiter       78            6          82000       8.2
15133     *        Saturn        87           14         263000      24.6
15134     *        Uranus        86            7         661000      27.4
15135     *        Neptune       11            2         248000      21.4
15136     *</pre>
15137     * <li> The present JSOFA re-implementation of the original Simon et al.
15138     *     Fortran code differs from the original in the following respects:
15139     *<ul>
15140     *       <li>  C instead of Fortran.
15141     *
15142     *       <li>  The date is supplied in two parts.
15143     *
15144     *       <li>  The result is returned only in equatorial Cartesian form;
15145     *          the ecliptic longitude, latitude and radius vector are not
15146     *          returned.
15147     *
15148     *       <li>  The result is in the J2000.0 equatorial frame, not ecliptic.
15149     *
15150     *       <li>  More is done in-line: there are fewer calls to subroutines.
15151     *
15152     *       <li>  Different error/warning status values are used.
15153     *
15154     *       <li>  A different Kepler's-equation-solver is used (avoiding
15155     *          use of double precision complex).
15156     *
15157     *       <li>  Polynomials in t are nested to minimize rounding errors.
15158     *
15159     *       <li>  Explicit double constants are used to avoid mixed-mode
15160     *          expressions.
15161     *</ul>
15162     *     None of the above changes affects the result significantly.
15163     *
15164     * <li> The returned status indicates the most serious condition
15165     *     encountered during execution of the function.  Illegal np is
15166     *     considered the most serious, overriding failure to converge,
15167     *     which in turn takes precedence over the remote date warning.
15168     *</ol>
15169     *<p>Called:<ul>
15170     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
15171     * </ul>
15172     *<p>Reference:  Simon, J.L, Bretagnon, P., Chapront, J.,
15173     *              Chapront-Touze, M., Francou, G., and Laskar, J.,
15174     *              Astron. Astrophys. 282, 663 (1994).
15175     *
15176     *@version 2009 December 17
15177     * @throws JSOFAIllegalParameter for a bad np (planet number)
15178     *
15179     *  @since Release 20101201
15180     *
15181     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15182     */
15183     public static double[][] jauPlan94(double date1, double date2, int np) throws JSOFAIllegalParameter
15184     {
15185        double pv[][] = new double[2][3];
15186     /* Gaussian constant */
15187        final double GK = 0.017202098950;
15188 
15189     /* Sin and cos of J2000.0 mean obliquity (IAU 1976) */
15190        final double SINEPS = 0.3977771559319137;
15191        final double COSEPS = 0.9174820620691818;
15192 
15193     /* Maximum number of iterations allowed to solve Kepler's equation */
15194        final int KMAX = 10;
15195 
15196        int k;
15197        int jstat;
15198        double t, da, dl, de, dp, di, dom, dmu, arga, argl, am,
15199               ae, dae, ae2, at, r, v, si2, xq, xp, tl, xsw,
15200               xcw, xm2, xf, ci2, xms, xmc, xpxq2, x, y, z;
15201 
15202     /* Planetary inverse masses */
15203        final double amas[] = { 6023600.0,       /* Mercury */
15204                                        408523.5,       /* Venus   */
15205                                        328900.5,       /* EMB     */
15206                                       3098710.0,       /* Mars    */
15207                                          1047.355,     /* Jupiter */
15208                                          3498.5,       /* Saturn  */
15209                                         22869.0,       /* Uranus  */
15210                                         19314.0 };     /* Neptune */
15211 
15212     /*
15213     * Tables giving the mean Keplerian elements, limited to t^2 terms:
15214     *
15215     *   a       semi-major axis (au)
15216     *   dlm     mean longitude (degree and arcsecond)
15217     *   e       eccentricity
15218     *   pi      longitude of the perihelion (degree and arcsecond)
15219     *   dinc    inclination (degree and arcsecond)
15220     *   omega   longitude of the ascending node (degree and arcsecond)
15221     */
15222 
15223        final double a[][] = {
15224            {  0.3870983098,           0.0,     0.0 },  /* Mercury */
15225            {  0.7233298200,           0.0,     0.0 },  /* Venus   */
15226            {  1.0000010178,           0.0,     0.0 },  /* EMB     */
15227            {  1.5236793419,         3e-10,     0.0 },  /* Mars    */
15228            {  5.2026032092,     19132e-10, -39e-10 },  /* Jupiter */
15229            {  9.5549091915, -0.0000213896, 444e-10 },  /* Saturn  */
15230            { 19.2184460618,     -3716e-10, 979e-10 },  /* Uranus  */
15231            { 30.1103868694,    -16635e-10, 686e-10 }   /* Neptune */
15232        };
15233 
15234        final double dlm[][] = {
15235            { 252.25090552, 5381016286.88982,  -1.92789 },
15236            { 181.97980085, 2106641364.33548,   0.59381 },
15237            { 100.46645683, 1295977422.83429,  -2.04411 },
15238            { 355.43299958,  689050774.93988,   0.94264 },
15239            {  34.35151874,  109256603.77991, -30.60378 },
15240            {  50.07744430,   43996098.55732,  75.61614 },
15241            { 314.05500511,   15424811.93933,  -1.75083 },
15242            { 304.34866548,    7865503.20744,   0.21103 }
15243        };
15244 
15245        final double e[][] = {
15246            { 0.2056317526,  0.0002040653,    -28349e-10 },
15247            { 0.0067719164, -0.0004776521,     98127e-10 },
15248            { 0.0167086342, -0.0004203654, -0.0000126734 },
15249            { 0.0934006477,  0.0009048438,    -80641e-10 },
15250            { 0.0484979255,  0.0016322542, -0.0000471366 },
15251            { 0.0555481426, -0.0034664062, -0.0000643639 },
15252            { 0.0463812221, -0.0002729293,  0.0000078913 },
15253            { 0.0094557470,  0.0000603263,           0.0 }
15254        };
15255 
15256        final double pi[][] = {
15257            {  77.45611904,  5719.11590,   -4.83016 },
15258            { 131.56370300,   175.48640, -498.48184 },
15259            { 102.93734808, 11612.35290,   53.27577 },
15260            { 336.06023395, 15980.45908,  -62.32800 },
15261            {  14.33120687,  7758.75163,  259.95938 },
15262            {  93.05723748, 20395.49439,  190.25952 },
15263            { 173.00529106,  3215.56238,  -34.09288 },
15264            {  48.12027554,  1050.71912,   27.39717 }
15265        };
15266 
15267        final double dinc[][] = {
15268            { 7.00498625, -214.25629,   0.28977 },
15269            { 3.39466189,  -30.84437, -11.67836 },
15270            {        0.0,  469.97289,  -3.35053 },
15271            { 1.84972648, -293.31722,  -8.11830 },
15272            { 1.30326698,  -71.55890,  11.95297 },
15273            { 2.48887878,   91.85195, -17.66225 },
15274            { 0.77319689,  -60.72723,   1.25759 },
15275            { 1.76995259,    8.12333,   0.08135 }
15276        };
15277 
15278        final double omega[][] = {
15279            {  48.33089304,  -4515.21727,  -31.79892 },
15280            {  76.67992019, -10008.48154,  -51.32614 },
15281            { 174.87317577,  -8679.27034,   15.34191 },
15282            {  49.55809321, -10620.90088, -230.57416 },
15283            { 100.46440702,   6362.03561,  326.52178 },
15284            { 113.66550252,  -9240.19942,  -66.23743 },
15285            {  74.00595701,   2669.15033,  145.93964 },
15286            { 131.78405702,   -221.94322,   -0.78728 }
15287        };
15288 
15289     /* Tables for trigonometric terms to be added to the mean elements of */
15290     /* the semi-major axes */
15291 
15292        final double kp[][] = {
15293         {   69613, 75645, 88306, 59899, 15746, 71087, 142173,  3086,    0 },
15294         {   21863, 32794, 26934, 10931, 26250, 43725,  53867, 28939,    0 },
15295         {   16002, 21863, 32004, 10931, 14529, 16368,  15318, 32794,    0 },
15296         {    6345,  7818, 15636,  7077,  8184, 14163,   1107,  4872,    0 },
15297         {    1760,  1454,  1167,   880,   287,  2640,     19,  2047, 1454 },
15298         {     574,     0,   880,   287,    19,  1760,   1167,   306,  574 },
15299         {     204,     0,   177,  1265,     4,   385,    200,   208,  204 },
15300         {       0,   102,   106,     4,    98,  1367,    487,   204,    0 }
15301        };
15302 
15303        final double ca[][] = {
15304         {       4,    -13,    11,   -9,    -9,   -3,     -1,     4,     0 },
15305         {    -156,     59,   -42,    6,    19,  -20,    -10,   -12,     0 },
15306         {      64,   -152,    62,   -8,    32,  -41,     19,   -11,     0 },
15307         {     124,    621,  -145,  208,    54,  -57,     30,    15,     0 },
15308         {  -23437,  -2634,  6601, 6259, -1507,-1821,   2620, -2115, -1489 },
15309         {   62911,-119919, 79336,17814,-24241,12068,   8306, -4893,  8902 },
15310         {  389061,-262125,-44088, 8387,-22976,-2093,   -615, -9720,  6633 },
15311         { -412235,-157046,-31430,37817, -9740,  -13,  -7449,  9644,     0 }
15312        };
15313 
15314        final double sa[][] = {
15315         {     -29,    -1,     9,     6,    -6,     5,     4,     0,     0 },
15316         {     -48,  -125,   -26,   -37,    18,   -13,   -20,    -2,     0 },
15317         {    -150,   -46,    68,    54,    14,    24,   -28,    22,     0 },
15318         {    -621,   532,  -694,   -20,   192,   -94,    71,   -73,     0 },
15319         {  -14614,-19828, -5869,  1881, -4372, -2255,   782,   930,   913 },
15320         {  139737,     0, 24667, 51123, -5102,  7429, -4095, -1976, -9566 },
15321         { -138081,     0, 37205,-49039,-41901,-33872,-27037,-12474, 18797 },
15322         {       0, 28492,133236, 69654, 52322,-49577,-26430, -3593,     0 }
15323        };
15324 
15325     /* Tables giving the trigonometric terms to be added to the mean */
15326     /* elements of the mean longitudes */
15327 
15328        final double kq[][] = {
15329         {   3086,15746,69613,59899,75645,88306, 12661,  2658,    0,     0 },
15330         {  21863,32794,10931,   73, 4387,26934,  1473,  2157,    0,     0 },
15331         {     10,16002,21863,10931, 1473,32004,  4387,    73,    0,     0 },
15332         {     10, 6345, 7818, 1107,15636, 7077,  8184,   532,   10,     0 },
15333         {     19, 1760, 1454,  287, 1167,  880,   574,  2640,   19,  1454 },
15334         {     19,  574,  287,  306, 1760,   12,    31,    38,   19,   574 },
15335         {      4,  204,  177,    8,   31,  200,  1265,   102,    4,   204 },
15336         {      4,  102,  106,    8,   98, 1367,   487,   204,    4,   102 }
15337        };
15338 
15339        final double cl[][] = {
15340         {      21,   -95, -157,   41,   -5,   42,  23,  30,      0,     0 },
15341         {    -160,  -313, -235,   60,  -74,  -76, -27,  34,      0,     0 },
15342         {    -325,  -322,  -79,  232,  -52,   97,  55, -41,      0,     0 },
15343         {    2268,  -979,  802,  602, -668,  -33, 345, 201,    -55,     0 },
15344         {    7610, -4997,-7689,-5841,-2617, 1115,-748,-607,   6074,   354 },
15345         {  -18549, 30125,20012, -730,  824,   23,1289,-352, -14767, -2062 },
15346         { -135245,-14594, 4197,-4030,-5630,-2898,2540,-306,   2939,  1986 },
15347         {   89948,  2103, 8963, 2695, 3682, 1648, 866,-154,  -1963,  -283 }
15348        };
15349 
15350        final double sl[][] = {
15351         {   -342,   136,  -23,   62,   66,  -52, -33,    17,     0,     0 },
15352         {    524,  -149,  -35,  117,  151,  122, -71,   -62,     0,     0 },
15353         {   -105,  -137,  258,   35, -116,  -88,-112,   -80,     0,     0 },
15354         {    854,  -205, -936, -240,  140, -341, -97,  -232,   536,     0 },
15355         { -56980,  8016, 1012, 1448,-3024,-3710, 318,   503,  3767,   577 },
15356         { 138606,-13478,-4964, 1441,-1319,-1482, 427,  1236, -9167, -1918 },
15357         {  71234,-41116, 5334,-4935,-1848,   66, 434, -1748,  3780,  -701 },
15358         { -47645, 11647, 2166, 3194,  679,    0,-244,  -419, -2531,    48 }
15359        };
15360 
15361     /*--------------------------------------------------------------------*/
15362 
15363     /* Validate the planet number. */
15364        if ((np < 1) || (np > 8)) {
15365           throw new JSOFAIllegalParameter("planet number out of range", -1);
15366 
15367        } else {
15368 
15369        /* Decrement the planet number to start at zero. */
15370           np--;
15371 
15372        /* Time: Julian millennia since J2000.0. */
15373           t = ((date1 - DJ00) + date2) / DJM;
15374 
15375        /* OK status unless remote date. */
15376           jstat = abs(t) <= 1.0 ? 0 : 1;
15377        // do not signal as error..   if(jstat != 0) throw new JSOFAIllegalParameter("Date too remote", jstat);
15378 
15379        /* Compute the mean elements. */
15380           da = a[np][0] +
15381               (a[np][1] +
15382                a[np][2] * t) * t;
15383           dl = (3600.0 * dlm[np][0] +
15384                         (dlm[np][1] +
15385                          dlm[np][2] * t) * t) * DAS2R;
15386           de = e[np][0] +
15387              ( e[np][1] +
15388                e[np][2] * t) * t;
15389           dp = jauAnpm((3600.0 * pi[np][0] +
15390                                 (pi[np][1] +
15391                                  pi[np][2] * t) * t) * DAS2R);
15392           di = (3600.0 * dinc[np][0] +
15393                         (dinc[np][1] +
15394                          dinc[np][2] * t) * t) * DAS2R;
15395           dom = jauAnpm((3600.0 * omega[np][0] +
15396                                  (omega[np][1] +
15397                                   omega[np][2] * t) * t) * DAS2R);
15398 
15399        /* Apply the trigonometric terms. */
15400           dmu = 0.35953620 * t;
15401           for (k = 0; k < 8; k++) {
15402              arga = kp[np][k] * dmu;
15403              argl = kq[np][k] * dmu;
15404              da += (ca[np][k] * cos(arga) +
15405                     sa[np][k] * sin(arga)) * 1e-7;
15406              dl += (cl[np][k] * cos(argl) +
15407                     sl[np][k] * sin(argl)) * 1e-7;
15408           }
15409           arga = kp[np][8] * dmu;
15410           da += t * (ca[np][8] * cos(arga) +
15411                      sa[np][8] * sin(arga)) * 1e-7;
15412           for (k = 8; k < 10; k++) {
15413              argl = kq[np][k] * dmu;
15414              dl += t * (cl[np][k] * cos(argl) +
15415                         sl[np][k] * sin(argl)) * 1e-7;
15416           }
15417           dl = fmod(dl, D2PI);
15418 
15419        /* Iterative soln. of Kepler's equation to get eccentric anomaly. */
15420           am = dl - dp;
15421           ae = am + de * sin(am);
15422           k = 0;
15423           dae = 1.0;
15424           while (k < KMAX && abs(dae) > 1e-12) {
15425              dae = (am - ae + de * sin(ae)) / (1.0 - de * cos(ae));
15426              ae += dae;
15427              k++;
15428              if (k == KMAX-1) jstat = 2;
15429           }
15430 
15431        /* True anomaly. */
15432           ae2 = ae / 2.0;
15433           at = 2.0 * atan2(sqrt((1.0 + de) / (1.0 - de)) * sin(ae2),
15434                                                            cos(ae2));
15435 
15436        /* Distance (au) and speed (radians per day). */
15437           r = da * (1.0 - de * cos(ae));
15438           v = GK * sqrt((1.0 + 1.0 / amas[np]) / (da * da * da));
15439 
15440           si2 = sin(di / 2.0);
15441           xq = si2 * cos(dom);
15442           xp = si2 * sin(dom);
15443           tl = at + dp;
15444           xsw = sin(tl);
15445           xcw = cos(tl);
15446           xm2 = 2.0 * (xp * xcw - xq * xsw);
15447           xf = da / sqrt(1  -  de * de);
15448           ci2 = cos(di / 2.0);
15449           xms = (de * sin(dp) + xsw) * xf;
15450           xmc = (de * cos(dp) + xcw) * xf;
15451           xpxq2 = 2 * xp * xq;
15452 
15453        /* Position (J2000.0 ecliptic x,y,z in au). */
15454           x = r * (xcw - xm2 * xp);
15455           y = r * (xsw + xm2 * xq);
15456           z = r * (-xm2 * ci2);
15457 
15458        /* Rotate to equatorial. */
15459           pv[0][0] = x;
15460           pv[0][1] = y * COSEPS - z * SINEPS;
15461           pv[0][2] = y * SINEPS + z * COSEPS;
15462 
15463        /* Velocity (J2000.0 ecliptic xdot,ydot,zdot in au/d). */
15464           x = v * (( -1.0 + 2.0 * xp * xp) * xms + xpxq2 * xmc);
15465           y = v * ((  1.0 - 2.0 * xq * xq) * xmc - xpxq2 * xms);
15466           z = v * (2.0 * ci2 * (xp * xms + xq * xmc));
15467 
15468        /* Rotate to equatorial. */
15469           pv[1][0] = x;
15470           pv[1][1] = y * COSEPS - z * SINEPS;
15471           pv[1][2] = y * SINEPS + z * COSEPS;
15472 
15473        }
15474 
15475     /* Return the value. */
15476        return pv;
15477 
15478         }
15479     
15480 
15481     /**
15482     *  Modulus of p-vector.
15483     *
15484     *<p>This function is derived from the International Astronomical Union's
15485     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15486     *
15487     *<p>Status:  vector/matrix support function.
15488     *
15489     *<!-- Given: -->
15490     *     @param p       double[3]      p-vector
15491     *
15492     * <!-- Returned (function value): -->
15493     *  @return double        modulus
15494     *
15495     *@version 2008 May 22
15496     *
15497     *  @since Release 20101201
15498     *
15499     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15500     */
15501     public static double jauPm(double p[] )
15502     {
15503        double w;
15504 
15505 
15506        w  = sqrt( p[0] * p[0]
15507                 + p[1] * p[1]
15508                 + p[2] * p[2] );
15509 
15510        return w;
15511 
15512         }
15513     
15514 
15515     /**
15516     *  Precession matrix (including frame bias) from GCRS to a specified
15517     *  date, IAU 2000 model.
15518     *
15519     *<p>This function is derived from the International Astronomical Union's
15520     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15521     *
15522     *<p>Status:  support function.
15523     *
15524     *<!-- Given: -->
15525     *     @param date1 double TT as a 2-part Julian Date (Note 1)
15526     *     @param date2 double TT as a 2-part Julian Date (Note 1)
15527     *
15528     *<!-- Returned: -->
15529     *     @return rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 2)
15530     *
15531     * <p>Notes:
15532     * <ol>
15533     *
15534     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15535     *     convenient way between the two arguments.  For example,
15536     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15537     *     among others:
15538     *<pre>
15539     *            date1          date2
15540     *
15541     *         2450123.7           0.0       (JD method)
15542     *         2451545.0       -1421.3       (J2000 method)
15543     *         2400000.5       50123.2       (MJD method)
15544     *         2450123.5           0.2       (date &amp; time method)
15545     *</pre>
15546     *     The JD method is the most natural and convenient to use in
15547     *     cases where the loss of several decimal digits of resolution
15548     *     is acceptable.  The J2000 method is best matched to the way
15549     *     the argument is handled internally and will deliver the
15550     *     optimum resolution.  The MJD method and the date &amp; time methods
15551     *     are both good compromises between resolution and convenience.
15552     *
15553     * <li> The matrix operates in the sense V(date) = rbp * V(GCRS), where
15554     *     the p-vector V(GCRS) is with respect to the Geocentric Celestial
15555     *     Reference System (IAU, 2000) and the p-vector V(date) is with
15556     *     respect to the mean equatorial triad of the given date.
15557     *</ol>
15558     *<p>Called:<ul>
15559     *     <li>{@link #jauBp00} frame bias and precession matrices, IAU 2000
15560     * </ul>
15561     *<p>Reference:
15562     *
15563     *     IAU: Trans. International Astronomical Union, Vol. XXIVB;  Proc.
15564     *     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
15565     *     (2000)
15566     *
15567     *@version 2009 December 21
15568     *
15569     *  @since Release 20101201
15570     *
15571     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15572     */
15573     public static double[][] jauPmat00(double date1, double date2)
15574     {
15575        double rb[][] = new double[3][3], rp[][] = new double[3][3],
15576            rbp[][] = new double[3][3];
15577     /* Obtain the required matrix (discarding others). */
15578        jauBp00(date1, date2, rb, rp, rbp);
15579 
15580        return rbp;
15581 
15582         }
15583     
15584 
15585     /**
15586     *  Precession matrix (including frame bias) from GCRS to a specified
15587     *  date, IAU 2006 model.
15588     *
15589     *<p>This function is derived from the International Astronomical Union's
15590     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15591     *
15592     *<p>Status:  support function.
15593     *
15594     *<!-- Given: -->
15595     *     @param date1 double TT as a 2-part Julian Date (Note 1)
15596     *     @param date2 double TT as a 2-part Julian Date (Note 1)
15597     *
15598     *<!-- Returned: -->
15599     *     @return rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 2)
15600     *
15601     * <p>Notes:
15602     * <ol>
15603     *
15604     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15605     *     convenient way between the two arguments.  For example,
15606     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15607     *     among others:
15608     *<pre>
15609     *            date1          date2
15610     *
15611     *         2450123.7           0.0       (JD method)
15612     *         2451545.0       -1421.3       (J2000 method)
15613     *         2400000.5       50123.2       (MJD method)
15614     *         2450123.5           0.2       (date &amp; time method)
15615     *</pre>
15616     *     The JD method is the most natural and convenient to use in
15617     *     cases where the loss of several decimal digits of resolution
15618     *     is acceptable.  The J2000 method is best matched to the way
15619     *     the argument is handled internally and will deliver the
15620     *     optimum resolution.  The MJD method and the date &amp; time methods
15621     *     are both good compromises between resolution and convenience.
15622     *
15623     * <li> The matrix operates in the sense V(date) = rbp * V(GCRS), where
15624     *     the p-vector V(GCRS) is with respect to the Geocentric Celestial
15625     *     Reference System (IAU, 2000) and the p-vector V(date) is with
15626     *     respect to the mean equatorial triad of the given date.
15627     *</ol>
15628     *<p>Called:<ul>
15629     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
15630     *     <li>{@link #jauFw2m} F-W angles to r-matrix
15631     * </ul>
15632     *<p>References:
15633     *
15634     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
15635     *
15636     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
15637     *    
15638     *    <p>IAU: Trans. International Astronomical Union, Vol. XXIVB;  Proc. 24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.(2000)
15639     *
15640     *@version 2009 December 21
15641     *
15642     *  @since Release 20101201
15643     *
15644     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15645     */
15646     public static double[][] jauPmat06(double date1, double date2)
15647     {
15648 
15649     /* Bias-precession Fukushima-Williams angles. */
15650        FWPrecessionAngles fw = jauPfw06(date1, date2);
15651 
15652     /* Form the matrix. */
15653        double[][] rbp = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa );
15654 
15655        return rbp;
15656 
15657         }
15658     
15659 
15660     /**
15661     *  Precession matrix from J2000.0 to a specified date, IAU 1976 model.
15662     *
15663     *<p>This function is derived from the International Astronomical Union's
15664     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15665     *
15666     *<p>Status:  support function.
15667     *
15668     *<!-- Given: -->
15669     *     @param date1 double        ending date, TT (Note 1)
15670     *     @param date2 double        ending date, TT (Note 1) 
15671     *
15672     *<!-- Returned: -->
15673     *     @return rmatp        double[3][3]   <u>returned</u> precession matrix, J2000.0 -&gt; date1+date2
15674     *
15675     * <p>Notes:
15676     * <ol>
15677     *
15678     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15679     *     convenient way between the two arguments.  For example,
15680     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15681     *     among others:
15682     *<pre>
15683     *            date1          date2
15684     *
15685     *         2450123.7           0.0       (JD method)
15686     *         2451545.0       -1421.3       (J2000 method)
15687     *         2400000.5       50123.2       (MJD method)
15688     *         2450123.5           0.2       (date &amp; time method)
15689     *</pre>
15690     *     The JD method is the most natural and convenient to use in
15691     *     cases where the loss of several decimal digits of resolution
15692     *     is acceptable.  The J2000 method is best matched to the way
15693     *     the argument is handled internally and will deliver the
15694     *     optimum resolution.  The MJD method and the date &amp; time methods
15695     *     are both good compromises between resolution and convenience.
15696     *
15697     * <li> The matrix operates in the sense V(date) = RMATP * V(J2000),
15698     *     where the p-vector V(J2000) is with respect to the mean
15699     *     equatorial triad of epoch J2000.0 and the p-vector V(date)
15700     *     is with respect to the mean equatorial triad of the given
15701     *     date.
15702     *
15703     * <li> Though the matrix method itself is rigorous, the precession
15704     *     angles are expressed through canonical polynomials which are
15705     *     valid only for a limited time span.  In addition, the IAU 1976
15706     *     precession rate is known to be imperfect.  The absolute accuracy
15707     *     of the present formulation is better than 0.1 arcsec from
15708     *     1960AD to 2040AD, better than 1 arcsec from 1640AD to 2360AD,
15709     *     and remains below 3 arcsec for the whole of the period
15710     *     500BC to 3000AD.  The errors exceed 10 arcsec outside the
15711     *     range 1200BC to 3900AD, exceed 100 arcsec outside 4200BC to
15712     *     5600AD and exceed 1000 arcsec outside 6800BC to 8200AD.
15713     *</ol>
15714     *<p>Called:<ul>
15715     *     <li>{@link #jauPrec76} accumulated precession angles, IAU 1976
15716     *     <li>{@link #jauIr} initialize r-matrix to identity
15717     *     <li>{@link #jauRz} rotate around Z-axis
15718     *     <li>{@link #jauRy} rotate around Y-axis
15719     *     <li>{@link #jauCr} copy r-matrix
15720     * </ul>
15721     *<p>References:
15722     *
15723     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
15724     *      equations (6) &amp; (7), p283.
15725     *
15726     *     Kaplan,G.H., 1981. USNO circular no. 163, pA2.
15727     *
15728     *@version 2009 December 18
15729     *
15730     *  @since Release 20101201
15731     *
15732     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15733     */
15734     public static double[][] jauPmat76(double date1, double date2)
15735     {
15736        double wmat[][] = new double[3][3];
15737        double rmatp[][] = new double[3][3];
15738 
15739     /* Precession Euler angles, J2000.0 to specified date. */
15740        EulerAngles euler = jauPrec76(DJ00, 0.0, date1, date2);
15741 
15742     /* Form the rotation matrix. */
15743        jauIr(  wmat);
15744        jauRz( -euler.zeta, wmat);
15745        jauRy(  euler.theta, wmat);
15746        jauRz( -euler.z, wmat);
15747        jauCr(wmat, rmatp);
15748 
15749        return rmatp;
15750 
15751         }
15752     
15753 
15754     /**
15755     *  P-vector subtraction.
15756     *
15757     *<p>This function is derived from the International Astronomical Union's
15758     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15759     *
15760     *<p>Status:  vector/matrix support function.
15761     *
15762     *<!-- Given: -->
15763     *     @param a         double[3]       first p-vector
15764     *     @param b         double[3]       second p-vector
15765     *
15766     *<!-- Returned: -->
15767     *     @return amb       double[3]        <u>returned</u> a - b
15768     *
15769     *  Note:
15770     *     It is permissible to re-use the same array for any of the
15771     *     arguments.
15772     *
15773     *@version 2008 November 18
15774     *
15775     *  @since Release 20101201
15776     *
15777     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15778     */
15779     public static double[]  jauPmp(double a[] , double b[]  )
15780     {
15781        double amb[] = new double[3];
15782        amb[0] = a[0] - b[0];
15783        amb[1] = a[1] - b[1];
15784        amb[2] = a[2] - b[2];
15785 
15786        return amb;
15787 
15788         }
15789     
15790     /**
15791      * A normalized vector with r being the modulus and u[3] being the unit vector.
15792      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
15793      * 
15794      * @since AIDA Stage 1
15795      */
15796     public static class NormalizedVector {
15797         public double r;
15798         public double u[];
15799         public NormalizedVector(double r, double u[] ) {
15800             this.r = r;
15801             this.u = u;
15802         }
15803     }
15804     /**
15805     *  Convert a p-vector into modulus and unit vector.
15806     *
15807     *<p>This function is derived from the International Astronomical Union's
15808     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15809     *
15810     *<p>Status:  vector/matrix support function.
15811     *
15812     *<!-- Given: -->
15813     *     @param p         double[3]       p-vector
15814     *
15815     *<!-- Returned: -->
15816     *     @return r         double           <u>returned</u> modulus
15817     *             u         double[3]        <u>returned</u> unit vector
15818     *
15819     * <p>Notes:
15820     * <ol>
15821     *
15822     * <li> If p is null, the result is null.  Otherwise the result is a unit
15823     *     vector.
15824     *
15825     * <li> It is permissible to re-use the same array for any of the
15826     *     arguments.
15827     *</ol>
15828     *<p>Called:<ul>
15829     *     <li>{@link #jauPm} modulus of p-vector
15830     *     <li>{@link #jauZp} zero p-vector
15831     *     <li>{@link #jauSxp} multiply p-vector by scalar
15832     * </ul>
15833     *@version 2008 November 18
15834     *
15835     *  @since Release 20101201
15836     *
15837     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15838     */
15839     public static NormalizedVector jauPn(double p[])
15840     {
15841        double w;
15842 
15843     /* Obtain the modulus and test for zero. */
15844        w = jauPm(p);
15845        NormalizedVector nv = new NormalizedVector(w, new double[3]);
15846        if (w == 0.0) {
15847 
15848        /* Null vector. */
15849           jauZp(nv.u);
15850 
15851        } else {
15852 
15853        /* Unit vector. */
15854            nv.u = jauSxp(1.0/w, p);
15855        }
15856 
15857 
15858        return nv;
15859 
15860         }
15861     
15862 
15863     /**
15864     *  Precession-nutation, IAU 2000 model:  a multi-purpose function,
15865     *  supporting classical (equinox-based) use directly and CIO-based
15866     *  use indirectly.
15867     *
15868     *<p>This function is derived from the International Astronomical Union's
15869     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15870     *
15871     *<p>Status:  support function.
15872     *
15873     *<!-- Given: -->
15874     *     @param date1 double TT as a 2-part Julian Date (Note 1)
15875     *     @param date2 double TT as a 2-part Julian Date (Note 1)
15876     *     @param dpsi double           nutation (Note 2)
15877     *     @param deps double           nutation (Note 2) 
15878     *
15879     *<!-- Returned: -->
15880     *     @return epsa          double            <u>returned</u> mean obliquity (Note 3),
15881     *             rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4),
15882     *             rp            double[3][3]      <u>returned</u> precession matrix (Note 5),
15883     *             rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6),
15884     *             rn            double[3][3]      <u>returned</u> nutation matrix (Note 7),
15885     *             rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Note 8)
15886     *
15887     * <p>Notes:
15888     * <ol>
15889     *
15890     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15891     *     convenient way between the two arguments.  For example,
15892     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15893     *     among others:
15894     *<pre>
15895     *            date1          date2
15896     *
15897     *         2450123.7           0.0       (JD method)
15898     *         2451545.0       -1421.3       (J2000 method)
15899     *         2400000.5       50123.2       (MJD method)
15900     *         2450123.5           0.2       (date &amp; time method)
15901     *</pre>
15902     *     The JD method is the most natural and convenient to use in
15903     *     cases where the loss of several decimal digits of resolution
15904     *     is acceptable.  The J2000 method is best matched to the way
15905     *     the argument is handled internally and will deliver the
15906     *     optimum resolution.  The MJD method and the date &amp; time methods
15907     *     are both good compromises between resolution and convenience.
15908     *
15909     * <li> The caller is responsible for providing the nutation components;
15910     *     they are in longitude and obliquity, in radians and are with
15911     *     respect to the equinox and ecliptic of date.  For high-accuracy
15912     *     applications, free core nutation should be included as well as
15913     *     any other relevant corrections to the position of the CIP.
15914     *
15915     * <li> The returned mean obliquity is consistent with the IAU 2000
15916     *     precession-nutation models.
15917     *
15918     * <li> The matrix rb transforms vectors from GCRS to J2000.0 mean
15919     *     equator and equinox by applying frame bias.
15920     *
15921     * <li> The matrix rp transforms vectors from J2000.0 mean equator and
15922     *     equinox to mean equator and equinox of date by applying
15923     *     precession.
15924     *
15925     * <li> The matrix rbp transforms vectors from GCRS to mean equator and
15926     *     equinox of date by applying frame bias then precession.  It is
15927     *     the product rp x rb.
15928     *
15929     * <li> The matrix rn transforms vectors from mean equator and equinox of
15930     *     date to true equator and equinox of date by applying the nutation
15931     *     (luni-solar + planetary).
15932     *
15933     * <li> The matrix rbpn transforms vectors from GCRS to true equator and
15934     *     equinox of date.  It is the product rn x rbp, applying frame
15935     *     bias, precession and nutation in that order.
15936     *
15937     * <li> It is permissible to re-use the same array in the returned
15938     *     arguments.  The arrays are filled in the stated order.
15939     *</ol>
15940     *<p>Called:<ul>
15941     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
15942     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
15943     *     <li>{@link #jauBp00} frame bias and precession matrices, IAU 2000
15944     *     <li>{@link #jauCr} copy r-matrix
15945     *     <li>{@link #jauNumat} form nutation matrix
15946     *     <li>{@link #jauRxr} product of two r-matrices
15947     * </ul>
15948     *<p>Reference:
15949     *
15950     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
15951     *     "Expressions for the Celestial Intermediate Pole and Celestial
15952     *     Ephemeris Origin consistent with the IAU 2000A precession-
15953     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
15954     *
15955     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
15956     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
15957     *
15958     *@version 2010 January 18
15959     *
15960     *  @since Release 20101201
15961     *
15962     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15963     */
15964     public static PrecessionNutation  jauPn00(double date1, double date2, double dpsi, double deps)
15965     {
15966        double  rbpw[][] = new double[3][3], rnw[][] = new double[3][3];
15967        double[][] rb = new double[3][3];
15968        double[][] rp = new double[3][3];
15969        double[][] rbp = new double[3][3];
15970        double[][] rn = new double[3][3];
15971        double[][] rbpn = new double[3][3];
15972 
15973 
15974     /* IAU 2000 precession-rate adjustments. */
15975        PrecessionDeltaTerms nut = jauPr00(date1, date2);
15976 
15977     /* Mean obliquity, consistent with IAU 2000 precession-nutation. */
15978        double epsa = jauObl80(date1, date2) + nut.depspr;
15979 
15980     /* Frame bias and precession matrices and their product. */
15981        jauBp00(date1, date2, rb, rp, rbpw);
15982        jauCr(rbpw, rbp);
15983 
15984     /* Nutation matrix. */
15985        rnw = jauNumat(epsa, dpsi, deps);
15986        jauCr(rnw, rn);
15987 
15988     /* Bias-precession-nutation matrix (classical). */
15989        rbpn = jauRxr(rnw, rbpw);
15990 
15991        return new PrecessionNutation(dpsi, deps, epsa, rb, rp, rbp, rn, rbpn);
15992 
15993         }
15994     
15995 
15996     /**
15997      * Precession-nutation model. 
15998      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
15999      * 
16000      * @since AIDA Stage 1
16001      */
16002     public static class PrecessionNutation {
16003         public NutationTerms nut;
16004         /** mean obliquity */
16005         public  double epsa;
16006         /** frame bias matrix */
16007         public double rb[][];
16008         /** precession matrix  */
16009         public  double rp[][];
16010         /** bias-precession matrix */
16011         public  double rbp[][];
16012         /** nutation matrix  */
16013         public double rn[][];
16014         /** GCRS-to-true matrix */
16015         public double rbpn[][];
16016         public PrecessionNutation(double dpsi, double deps, double epsa,
16017                   double rb[][], double rp[][], double rbp[][],
16018                   double rn[][], double rbpn[][]){
16019             this.nut = new NutationTerms(dpsi, deps);
16020             this.epsa = epsa;
16021             this.rb = rb; 
16022             this.rp = rp;
16023             this.rbp = rbp;
16024             this.rn = rn;
16025             this.rbpn = rbpn;
16026         }
16027         
16028     }
16029     /**
16030     *  Precession-nutation, IAU 2000A model:  a multi-purpose function,
16031     *  supporting classical (equinox-based) use directly and CIO-based
16032     *  use indirectly.
16033     *
16034     *<p>This function is derived from the International Astronomical Union's
16035     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16036     *
16037     *<p>Status:  support function.
16038     *
16039     *<!-- Given: -->
16040     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16041     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16042     *
16043     *<!-- Returned: -->
16044     *     @return dpsi double            <u>returned</u> nutation (Note 2)
16045     *             deps double            <u>returned</u> nutation (Note 2) 
16046     *             epsa          double            <u>returned</u> mean obliquity (Note 3)
16047     *             rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
16048     *             rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
16049     *             rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
16050     *             rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
16051     *             rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Notes 8,9)
16052     *
16053     * <p>Notes:
16054     * <ol>
16055     *
16056     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
16057     *      convenient way between the two arguments.  For example,
16058     *      JD(TT)=2450123.7 could be expressed in any of these ways,
16059     *      among others:
16060     *<pre>
16061     *             date1          date2
16062     *
16063     *          2450123.7           0.0       (JD method)
16064     *          2451545.0       -1421.3       (J2000 method)
16065     *          2400000.5       50123.2       (MJD method)
16066     *          2450123.5           0.2       (date &amp; time method)
16067     *</pre>
16068     *      The JD method is the most natural and convenient to use in
16069     *      cases where the loss of several decimal digits of resolution
16070     *      is acceptable.  The J2000 method is best matched to the way
16071     *      the argument is handled internally and will deliver the
16072     *      optimum resolution.  The MJD method and the date &amp; time methods
16073     *      are both good compromises between resolution and convenience.
16074     *
16075     * <li>  The nutation components (luni-solar + planetary, IAU 2000A) in
16076     *      longitude and obliquity are in radians and with respect to the
16077     *      equinox and ecliptic of date.  Free core nutation is omitted;
16078     *      for the utmost accuracy, use the jauPn00  function, where the
16079     *      nutation components are caller-specified.  For faster but
16080     *      slightly less accurate results, use the jauPn00b function.
16081     *
16082     * <li>  The mean obliquity is consistent with the IAU 2000 precession.
16083     *
16084     * <li>  The matrix rb transforms vectors from GCRS to J2000.0 mean
16085     *      equator and equinox by applying frame bias.
16086     *
16087     * <li>  The matrix rp transforms vectors from J2000.0 mean equator and
16088     *      equinox to mean equator and equinox of date by applying
16089     *      precession.
16090     *
16091     * <li>  The matrix rbp transforms vectors from GCRS to mean equator and
16092     *      equinox of date by applying frame bias then precession.  It is
16093     *      the product rp x rb.
16094     *
16095     * <li>  The matrix rn transforms vectors from mean equator and equinox
16096     *      of date to true equator and equinox of date by applying the
16097     *      nutation (luni-solar + planetary).
16098     *
16099     * <li>  The matrix rbpn transforms vectors from GCRS to true equator and
16100     *      equinox of date.  It is the product rn x rbp, applying frame
16101     *      bias, precession and nutation in that order.
16102     *
16103     * <li>  The X,Y,Z coordinates of the IAU 2000A Celestial Intermediate
16104     *      Pole are elements (3,1-3) of the GCRS-to-true matrix,
16105     *       i.e. rbpn[2][0-2].
16106     *
16107     *  <li> It is permissible to re-use the same array in the returned
16108     *      arguments.  The arrays are filled in the order given.
16109     *</ol>
16110     *<p>Called:<ul>
16111     *     <li>{@link #jauNut00a} nutation, IAU 2000A
16112     *     <li>{@link #jauPn00} bias/precession/nutation results, IAU 2000
16113     * </ul>
16114     *<p>Reference:
16115     *
16116     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
16117     *     "Expressions for the Celestial Intermediate Pole and Celestial
16118     *     Ephemeris Origin consistent with the IAU 2000A precession-
16119     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
16120     *
16121     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
16122     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
16123     *
16124     *@version 2010 January 18
16125     *
16126     *  @since Release 20101201
16127     *
16128     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16129     */
16130     public static PrecessionNutation jauPn00a(double date1, double date2)
16131     {
16132     /* Nutation. */
16133        NutationTerms nut = jauNut00a(date1, date2);
16134 
16135     /* Remaining results. */
16136        return jauPn00(date1, date2, nut.dpsi, nut.deps);
16137 
16138  
16139         }
16140     
16141 
16142     /**
16143     *  Precession-nutation, IAU 2000B model:  a multi-purpose function,
16144     *  supporting classical (equinox-based) use directly and CIO-based
16145     *  use indirectly.
16146     *
16147     *<p>This function is derived from the International Astronomical Union's
16148     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16149     *
16150     *<p>Status:  support function.
16151     *
16152     *<!-- Given: -->
16153     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16154     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16155     *
16156     *<!-- Returned: -->
16157     *     @return dpsi,deps     double            <u>returned</u> nutation (Note 2)
16158     *             epsa          double            <u>returned</u> mean obliquity (Note 3)
16159     *             rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
16160     *             rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
16161     *             rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
16162     *             rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
16163     *             rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Notes 8,9)
16164     *
16165     * <p>Notes:
16166     * <ol>
16167     *
16168     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
16169     *      convenient way between the two arguments.  For example,
16170     *      JD(TT)=2450123.7 could be expressed in any of these ways,
16171     *      among others:
16172     *<pre>
16173     *             date1          date2
16174     *
16175     *          2450123.7           0.0       (JD method)
16176     *          2451545.0       -1421.3       (J2000 method)
16177     *          2400000.5       50123.2       (MJD method)
16178     *          2450123.5           0.2       (date &amp; time method)
16179     *</pre>
16180     *      The JD method is the most natural and convenient to use in
16181     *      cases where the loss of several decimal digits of resolution
16182     *      is acceptable.  The J2000 method is best matched to the way
16183     *      the argument is handled internally and will deliver the
16184     *      optimum resolution.  The MJD method and the date &amp; time methods
16185     *      are both good compromises between resolution and convenience.
16186     *
16187     * <li>  The nutation components (luni-solar + planetary, IAU 2000B) in
16188     *      longitude and obliquity are in radians and with respect to the
16189     *      equinox and ecliptic of date.  For more accurate results, but
16190     *      at the cost of increased computation, use the jauPn00a function.
16191     *      For the utmost accuracy, use the jauPn00  function, where the
16192     *      nutation components are caller-specified.
16193     *
16194     * <li>  The mean obliquity is consistent with the IAU 2000 precession.
16195     *
16196     * <li>  The matrix rb transforms vectors from GCRS to J2000.0 mean
16197     *      equator and equinox by applying frame bias.
16198     *
16199     * <li>  The matrix rp transforms vectors from J2000.0 mean equator and
16200     *      equinox to mean equator and equinox of date by applying
16201     *      precession.
16202     *
16203     * <li>  The matrix rbp transforms vectors from GCRS to mean equator and
16204     *      equinox of date by applying frame bias then precession.  It is
16205     *      the product rp x rb.
16206     *
16207     * <li>  The matrix rn transforms vectors from mean equator and equinox
16208     *      of date to true equator and equinox of date by applying the
16209     *      nutation (luni-solar + planetary).
16210     *
16211     * <li>  The matrix rbpn transforms vectors from GCRS to true equator and
16212     *      equinox of date.  It is the product rn x rbp, applying frame
16213     *      bias, precession and nutation in that order.
16214     *
16215     * <li>  The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate
16216     *      Pole are elements (3,1-3) of the matrix rbpn.
16217     *
16218     * <li> It is permissible to re-use the same array in the returned
16219     *      arguments.  The arrays are filled in the stated order.
16220     *</ol>
16221     *<p>Called:<ul>
16222     *     <li>{@link #jauNut00b} nutation, IAU 2000B
16223     *     <li>{@link #jauPn00} bias/precession/nutation results, IAU 2000
16224     * </ul>
16225     *<p>Reference:
16226     *
16227     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
16228     *     "Expressions for the Celestial Intermediate Pole and Celestial
16229     *     Ephemeris Origin consistent with the IAU 2000A precession-
16230     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003).
16231     *
16232     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
16233     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
16234     *
16235     *@version 2010 January 18
16236     *
16237     *  @since Release 20101201
16238     *
16239     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16240     */
16241     public static PrecessionNutation jauPn00b(double date1, double date2)
16242     {
16243     /* Nutation. */
16244        NutationTerms nut = jauNut00b(date1, date2);
16245 
16246     /* Remaining results. */
16247        return jauPn00(date1, date2, nut.dpsi, nut.deps);
16248 
16249 
16250         }
16251     
16252 
16253     /**
16254     *  Precession-nutation, IAU 2006 model:  a multi-purpose function,
16255     *  supporting classical (equinox-based) use directly and CIO-based use
16256     *  indirectly.
16257     *
16258     *<p>This function is derived from the International Astronomical Union's
16259     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16260     *
16261     *<p>Status:  support function.
16262     *
16263     *<!-- Given: -->
16264     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16265     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16266     *     @param dpsi double           nutation (Note 2)
16267     *     @param deps double           nutation (Note 2) 
16268     *
16269     *<!-- Returned: -->
16270     *     @return epsa          double            <u>returned</u> mean obliquity (Note 3)
16271     *            rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
16272     *            rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
16273     *            rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
16274     *            rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
16275     *            rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Note 8,9)
16276     *
16277     * <p>Notes:
16278     * <ol>
16279     *
16280     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
16281     *      convenient way between the two arguments.  For example,
16282     *      JD(TT)=2450123.7 could be expressed in any of these ways,
16283     *      among others:
16284     *<pre>
16285     *             date1          date2
16286     *
16287     *          2450123.7           0.0       (JD method)
16288     *          2451545.0       -1421.3       (J2000 method)
16289     *          2400000.5       50123.2       (MJD method)
16290     *          2450123.5           0.2       (date &amp; time method)
16291     *</pre>
16292     *      The JD method is the most natural and convenient to use in
16293     *      cases where the loss of several decimal digits of resolution
16294     *      is acceptable.  The J2000 method is best matched to the way
16295     *      the argument is handled internally and will deliver the
16296     *      optimum resolution.  The MJD method and the date &amp; time methods
16297     *      are both good compromises between resolution and convenience.
16298     *
16299     * <li>  The caller is responsible for providing the nutation components;
16300     *      they are in longitude and obliquity, in radians and are with
16301     *      respect to the equinox and ecliptic of date.  For high-accuracy
16302     *      applications, free core nutation should be included as well as
16303     *      any other relevant corrections to the position of the CIP.
16304     *
16305     * <li>  The returned mean obliquity is consistent with the IAU 2006
16306     *      precession.
16307     *
16308     * <li>  The matrix rb transforms vectors from GCRS to J2000.0 mean
16309     *      equator and equinox by applying frame bias.
16310     *
16311     * <li>  The matrix rp transforms vectors from J2000.0 mean equator and
16312     *      equinox to mean equator and equinox of date by applying
16313     *      precession.
16314     *
16315     * <li>  The matrix rbp transforms vectors from GCRS to mean equator and
16316     *      equinox of date by applying frame bias then precession.  It is
16317     *      the product rp x rb.
16318     *
16319     * <li>  The matrix rn transforms vectors from mean equator and equinox
16320     *      of date to true equator and equinox of date by applying the
16321     *      nutation (luni-solar + planetary).
16322     *
16323     * <li>  The matrix rbpn transforms vectors from GCRS to true equator and
16324     *      equinox of date.  It is the product rn x rbp, applying frame
16325     *      bias, precession and nutation in that order.
16326     *
16327     * <li>  The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate
16328     *      Pole are elements (3,1-3) of the matrix rbpn.
16329     *
16330     *  <li> It is permissible to re-use the same array in the returned
16331     *      arguments.  The arrays are filled in the stated order.
16332     *</ol>
16333     *<p>Called:<ul>
16334     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
16335     *     <li>{@link #jauFw2m} F-W angles to r-matrix
16336     *     <li>{@link #jauCr} copy r-matrix
16337     *     <li>{@link #jauTr} transpose r-matrix
16338     *     <li>{@link #jauRxr} product of two r-matrices
16339     * </ul>
16340     *<p>References:
16341     *
16342     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
16343     *
16344     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
16345     *
16346     *@version 2009 December 17
16347     *
16348     *  @since Release 20101201
16349     *
16350     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16351     */
16352     public static PrecessionNutation jauPn06(double date1, double date2, double dpsi, double deps)
16353     {
16354 
16355         double rb[][] = new double[3][3], rbp[][] = new double[3][3], rbpn[][] = new double[3][3];
16356     /* Bias-precession Fukushima-Williams angles of J2000.0 = frame bias. */
16357        FWPrecessionAngles fw = jauPfw06(DJM0, DJM00);
16358 
16359     /* B matrix. */
16360        double[][] r1 = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa);
16361        jauCr(r1, rb);
16362 
16363     /* Bias-precession Fukushima-Williams angles of date. */
16364        fw = jauPfw06(date1, date2);
16365 
16366     /* Bias-precession matrix. */
16367        double[][] r2 = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa );
16368        jauCr(r2, rbp);
16369 
16370     /* Solve for precession matrix. */
16371        double[][] rt = jauTr(r1);
16372        double[][] rp = jauRxr(r2, rt);
16373 
16374     /* Equinox-based bias-precession-nutation matrix. */
16375        r1 = jauFw2m(fw.gamb, fw.phib, fw.psib + dpsi, fw.epsa + deps);
16376        jauCr(r1, rbpn);
16377 
16378     /* Solve for nutation matrix. */
16379        rt = jauTr(r2);
16380        double[][] rn = jauRxr(r1, rt);
16381 
16382     /* Obliquity, mean of date. */
16383        double epsa = fw.epsa;
16384 
16385        return new PrecessionNutation(dpsi, deps, epsa, rb, rp, rbp, rn, rbpn);
16386 
16387         }
16388     
16389 
16390     /**
16391     *  Precession-nutation, IAU 2006/2000A models:  a multi-purpose function,
16392     *  supporting classical (equinox-based) use directly and CIO-based use
16393     *  indirectly.
16394     *
16395     *<p>This function is derived from the International Astronomical Union's
16396     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16397     *
16398     *<p>Status:  support function.
16399     *
16400     *<!-- Given: -->
16401     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16402     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16403     *
16404     *<!-- Returned: -->
16405     *     @return dpsi,deps     double            <u>returned</u> nutation (Note 2)
16406     *            epsa          double            <u>returned</u> mean obliquity (Note 3)
16407     *            rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
16408     *            rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
16409     *            rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
16410     *            rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
16411     *            rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Notes 8,9)
16412     *
16413     * <p>Notes:
16414     * <ol>
16415     *
16416     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
16417     *      convenient way between the two arguments.  For example,
16418     *      JD(TT)=2450123.7 could be expressed in any of these ways,
16419     *      among others:
16420     *<pre>
16421     *             date1          date2
16422     *
16423     *          2450123.7           0.0       (JD method)
16424     *          2451545.0       -1421.3       (J2000 method)
16425     *          2400000.5       50123.2       (MJD method)
16426     *          2450123.5           0.2       (date &amp; time method)
16427     *</pre>
16428     *      The JD method is the most natural and convenient to use in
16429     *      cases where the loss of several decimal digits of resolution
16430     *      is acceptable.  The J2000 method is best matched to the way
16431     *      the argument is handled internally and will deliver the
16432     *      optimum resolution.  The MJD method and the date &amp; time methods
16433     *      are both good compromises between resolution and convenience.
16434     *
16435     * <li>  The nutation components (luni-solar + planetary, IAU 2000A) in
16436     *      longitude and obliquity are in radians and with respect to the
16437     *      equinox and ecliptic of date.  Free core nutation is omitted;
16438     *      for the utmost accuracy, use the jauPn06 function, where the
16439     *      nutation components are caller-specified.
16440     *
16441     * <li>  The mean obliquity is consistent with the IAU 2006 precession.
16442     *
16443     * <li>  The matrix rb transforms vectors from GCRS to mean J2000.0 by
16444     *      applying frame bias.
16445     *
16446     * <li>  The matrix rp transforms vectors from mean J2000.0 to mean of
16447     *      date by applying precession.
16448     *
16449     * <li>  The matrix rbp transforms vectors from GCRS to mean of date by
16450     *      applying frame bias then precession.  It is the product rp x rb.
16451     *
16452     * <li>  The matrix rn transforms vectors from mean of date to true of
16453     *      date by applying the nutation (luni-solar + planetary).
16454     *
16455     * <li>  The matrix rbpn transforms vectors from GCRS to true of date
16456     *      (CIP/equinox).  It is the product rn x rbp, applying frame bias,
16457     *      precession and nutation in that order.
16458     *
16459     * <li>  The X,Y,Z coordinates of the IAU 2006/2000A Celestial
16460     *      Intermediate Pole are elements (1,1-3) of the matrix rbpn.
16461     *
16462     *  <li> It is permissible to re-use the same array in the returned
16463     *      arguments.  The arrays are filled in the stated order.
16464     *</ol>
16465     *<p>Called:<ul>
16466     *     <li>{@link #jauNut06a} nutation, IAU 2006/2000A
16467     *     <li>{@link #jauPn06} bias/precession/nutation results, IAU 2006
16468     * </ul>
16469     *<p>Reference:
16470     *
16471     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
16472     *
16473     *@version 2009 December 18
16474     *
16475     *  @since Release 20101201
16476     *
16477     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16478     */
16479     public static PrecessionNutation jauPn06a(double date1, double date2)
16480     {
16481     /* Nutation. */
16482        NutationTerms nut = jauNut06a(date1, date2);
16483 
16484     /* Remaining results. */
16485        return jauPn06(date1, date2, nut.dpsi, nut.deps);
16486 
16487         }
16488     
16489 
16490     /**
16491     *  Form the matrix of precession-nutation for a given date (including
16492     *  frame bias), equinox-based, IAU 2000A model.
16493     *
16494     *<p>This function is derived from the International Astronomical Union's
16495     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16496     *
16497     *<p>Status:  support function.
16498     *
16499     *<!-- Given: -->
16500     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16501     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16502     *
16503     *<!-- Returned: -->
16504     *     @return rbpn          double[3][3]      <u>returned</u> bias-precession-nutation matrix (Note 2)
16505     *
16506     * <p>Notes:
16507     * <ol>
16508     *
16509     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16510     *     convenient way between the two arguments.  For example,
16511     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16512     *     among others:
16513     *<pre>
16514     *            date1          date2
16515     *
16516     *         2450123.7           0.0       (JD method)
16517     *         2451545.0       -1421.3       (J2000 method)
16518     *         2400000.5       50123.2       (MJD method)
16519     *         2450123.5           0.2       (date &amp; time method)
16520     *</pre>
16521     *     The JD method is the most natural and convenient to use in
16522     *     cases where the loss of several decimal digits of resolution
16523     *     is acceptable.  The J2000 method is best matched to the way
16524     *     the argument is handled internally and will deliver the
16525     *     optimum resolution.  The MJD method and the date &amp; time methods
16526     *     are both good compromises between resolution and convenience.
16527     *
16528     * <li> The matrix operates in the sense V(date) = rbpn * V(GCRS), where
16529     *     the p-vector V(date) is with respect to the true equatorial triad
16530     *     of date date1+date2 and the p-vector V(GCRS) is with respect to
16531     *     the Geocentric Celestial Reference System (IAU, 2000).
16532     *
16533     * <li> A faster, but slightly less accurate, result (about 1 mas), can be
16534     *     obtained by using instead the jauPnm00b function.
16535     *</ol>
16536     *<p>Called:<ul>
16537     *     <li>{@link #jauPn00a} bias/precession/nutation, IAU 2000A
16538     * </ul>
16539     *<p>Reference:
16540     *
16541     *     IAU: Trans. International Astronomical Union, Vol. XXIVB;  Proc.
16542     *     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
16543     *     (2000)
16544     *
16545     *@version 2009 December 21
16546     *
16547     *  @since Release 20101201
16548     *
16549     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16550     */
16551     public static double[][] jauPnm00a(double date1, double date2)
16552     {
16553 
16554     /* Obtain the required matrix (discarding other results). */
16555         PrecessionNutation pn = jauPn00a(date1, date2);
16556         return pn.rbpn;
16557 
16558     }
16559 
16560 
16561     /**
16562     *  Form the matrix of precession-nutation for a given date (including
16563     *  frame bias), equinox-based, IAU 2000B model.
16564     *
16565     *<p>This function is derived from the International Astronomical Union's
16566     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16567     *
16568     *<p>Status:  support function.
16569     *
16570     *<!-- Given: -->
16571     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16572     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16573     *
16574     *<!-- Returned: -->
16575     *     @return rbpn         double[3][3]   <u>returned</u> bias-precession-nutation matrix (Note 2)
16576     *
16577     * <p>Notes:
16578     * <ol>
16579     *
16580     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16581     *     convenient way between the two arguments.  For example,
16582     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16583     *     among others:
16584     *<pre>
16585     *            date1          date2
16586     *
16587     *         2450123.7           0.0       (JD method)
16588     *         2451545.0       -1421.3       (J2000 method)
16589     *         2400000.5       50123.2       (MJD method)
16590     *         2450123.5           0.2       (date &amp; time method)
16591     *</pre>
16592     *     The JD method is the most natural and convenient to use in
16593     *     cases where the loss of several decimal digits of resolution
16594     *     is acceptable.  The J2000 method is best matched to the way
16595     *     the argument is handled internally and will deliver the
16596     *     optimum resolution.  The MJD method and the date &amp; time methods
16597     *     are both good compromises between resolution and convenience.
16598     *
16599     * <li> The matrix operates in the sense V(date) = rbpn * V(GCRS), where
16600     *     the p-vector V(date) is with respect to the true equatorial triad
16601     *     of date date1+date2 and the p-vector V(GCRS) is with respect to
16602     *     the Geocentric Celestial Reference System (IAU, 2000).
16603     *
16604     * <li> The present function is faster, but slightly less accurate (about
16605     *     1 mas), than the jauPnm00a function.
16606     *</ol>
16607     *<p>Called:<ul>
16608     *     <li>{@link #jauPn00b} bias/precession/nutation, IAU 2000B
16609     * </ul>
16610     *<p>Reference:
16611     *
16612     *     IAU: Trans. International Astronomical Union, Vol. XXIVB;  Proc.
16613     *     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
16614     *     (2000)
16615     *
16616     *@version 2009 December 21
16617     *
16618     *  @since Release 20101201
16619     *
16620     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16621     */
16622     public static double[][] jauPnm00b(double date1, double date2)
16623     {
16624 
16625     /* Obtain the required matrix (discarding other results). */
16626        PrecessionNutation pn = jauPn00b(date1, date2);
16627 
16628        return pn.rbpn;
16629 
16630         }
16631     
16632 
16633     /**
16634     *  Form the matrix of precession-nutation for a given date (including
16635     *  frame bias), equinox based, IAU 2006 precession and IAU 2000A nutation models.
16636     *
16637     *<p>This function is derived from the International Astronomical Union's
16638     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16639     *
16640     *<p>Status:  support function.
16641     *
16642     *<!-- Given: -->
16643     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16644     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16645     *
16646     *<!-- Returned: -->
16647     *     @return rbpn         double[3][3]   <u>returned</u> bias-precession-nutation matrix (Note 2)
16648     *
16649     * <p>Notes:
16650     * <ol>
16651     *
16652     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16653     *     convenient way between the two arguments.  For example,
16654     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16655     *     among others:
16656     *<pre>
16657     *            date1          date2
16658     *
16659     *         2450123.7           0.0       (JD method)
16660     *         2451545.0       -1421.3       (J2000 method)
16661     *         2400000.5       50123.2       (MJD method)
16662     *         2450123.5           0.2       (date &amp; time method)
16663     *</pre>
16664     *     The JD method is the most natural and convenient to use in
16665     *     cases where the loss of several decimal digits of resolution
16666     *     is acceptable.  The J2000 method is best matched to the way
16667     *     the argument is handled internally and will deliver the
16668     *     optimum resolution.  The MJD method and the date &amp; time methods
16669     *     are both good compromises between resolution and convenience.
16670     *
16671     * <li> The matrix operates in the sense V(date) = rbpn * V(GCRS), where
16672     *     the p-vector V(date) is with respect to the true equatorial triad
16673     *     of date date1+date2 and the p-vector V(GCRS) is with respect to
16674     *     the Geocentric Celestial Reference System (IAU, 2000).
16675     *</ol>
16676     *<p>Called:<ul>
16677     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
16678     *     <li>{@link #jauNut06a} nutation, IAU 2006/2000A
16679     *     <li>{@link #jauFw2m} F-W angles to r-matrix
16680     * </ul>
16681     *<p>Reference:
16682     *
16683     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855.
16684     *
16685     *@version 2009 December 21
16686     *
16687     *  @since Release 20101201
16688     *
16689     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16690     */
16691     public static double[][] jauPnm06a(double date1, double date2)
16692     {
16693 
16694     /* Fukushima-Williams angles for frame bias and precession. */
16695        FWPrecessionAngles fw = jauPfw06(date1, date2);
16696 
16697     /* Nutation components. */
16698        NutationTerms nut = jauNut06a(date1, date2);
16699 
16700     /* Equinox based nutation x precession x bias matrix. */
16701        double[][] rbpn = jauFw2m(fw.gamb, fw.phib, fw.psib + nut.dpsi, fw.epsa + nut.deps);
16702 
16703        return rbpn;
16704 
16705         }
16706     
16707 
16708     /**
16709     *  Form the matrix of precession/nutation for a given date, IAU 1976
16710     *  precession model, IAU 1980 nutation model.
16711     *
16712     *<p>This function is derived from the International Astronomical Union's
16713     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16714     *
16715     *<p>Status:  support function.
16716     *
16717     *<!-- Given: -->
16718     *     @param date1 double          TDB date (Note 1)
16719     *     @param date2 double          TDB date (Note 1) 
16720     *
16721     *<!-- Returned: -->
16722     *     @return rmatpn          double[3][3]     <u>returned</u> combined precession/nutation matrix
16723     *
16724     * <p>Notes:
16725     * <ol>
16726     *
16727     * <li> The TDB date date1+date2 is a Julian Date, apportioned in any
16728     *     convenient way between the two arguments.  For example,
16729     *     JD(TDB)=2450123.7 could be expressed in any of these ways,
16730     *     among others:
16731     *<pre>
16732     *            date1          date2
16733     *
16734     *         2450123.7           0.0       (JD method)
16735     *         2451545.0       -1421.3       (J2000 method)
16736     *         2400000.5       50123.2       (MJD method)
16737     *         2450123.5           0.2       (date &amp; time method)
16738     *</pre>
16739     *     The JD method is the most natural and convenient to use in
16740     *     cases where the loss of several decimal digits of resolution
16741     *     is acceptable.  The J2000 method is best matched to the way
16742     *     the argument is handled internally and will deliver the
16743     *     optimum resolution.  The MJD method and the date &amp; time methods
16744     *     are both good compromises between resolution and convenience.
16745     *
16746     * <li> The matrix operates in the sense V(date) = rmatpn * V(J2000),
16747     *     where the p-vector V(date) is with respect to the true equatorial
16748     *     triad of date date1+date2 and the p-vector V(J2000) is with
16749     *     respect to the mean equatorial triad of epoch J2000.0.
16750     *</ol>
16751     *<p>Called:<ul>
16752     *     <li>{@link #jauPmat76} precession matrix, IAU 1976
16753     *     <li>{@link #jauNutm80} nutation matrix, IAU 1980
16754     *     <li>{@link #jauRxr} product of two r-matrices
16755     * </ul>
16756     *<p>Reference:
16757     *
16758     *     <p>Explanatory Supplement to the Astronomical Almanac,
16759     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
16760     *     Section 3.3 (p145).
16761     *
16762     *@version 2010 January 23
16763     *
16764     *  @since Release 20101201
16765     *
16766     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16767     */
16768     public static double[][] jauPnm80(double date1, double date2)
16769     {
16770        double rmatp[][] = new double[3][3], rmatn[][] = new double[3][3];
16771 
16772 
16773     /* Precession matrix, J2000.0 to date. */
16774        rmatp = jauPmat76(date1, date2 );
16775 
16776     /* Nutation matrix. */
16777        rmatn = jauNutm80(date1, date2);
16778 
16779     /* Combine the matrices:  PN = N x P. */
16780        double[][] rmatpn = jauRxr(rmatn, rmatp);
16781 
16782        return rmatpn;
16783 
16784         }
16785     
16786 
16787     /**
16788     *  Form the matrix of polar motion for a given date, IAU 2000.
16789     *
16790     *<p>This function is derived from the International Astronomical Union's
16791     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16792     *
16793     *<p>Status:  support function.
16794     *
16795     *<!-- Given: -->
16796     *     @param xp double     coordinates of the pole (radians, Note 1)
16797     *     @param yp double     coordinates of the pole (radians, Note 1) 
16798     *     @param sp        double     the TIO locator s' (radians, Note 2)
16799     *
16800     *<!-- Returned: -->
16801     *     @return     double[3][3]     <u>returned</u> polar-motion matrix (Note 3)
16802     *
16803     * <p>Notes:
16804     * <ol>
16805     *
16806     * <li> The arguments xp and yp are the coordinates (in radians) of the
16807     *     Celestial Intermediate Pole with respect to the International
16808     *     Terrestrial Reference System (see IERS Conventions 2003),
16809     *     measured along the meridians 0 and 90 deg west respectively.
16810     *
16811     * <li> The argument sp is the TIO locator s', in radians, which
16812     *     positions the Terrestrial Intermediate Origin on the equator.  It
16813     *     is obtained from polar motion observations by numerical
16814     *     integration, and so is in essence unpredictable.  However, it is
16815     *     dominated by a secular drift of about 47 microarcseconds per
16816     *     century, and so can be taken into account by using s' = -47*t,
16817     *     where t is centuries since J2000.0.  The function jauSp00
16818     *     implements this approximation.
16819     *
16820     * <li> The matrix operates in the sense V(TRS) = rpom * V(CIP), meaning
16821     *     that it is the final rotation when computing the pointing
16822     *     direction to a celestial source.
16823     *</ol>
16824     *<p>Called:<ul>
16825     *     <li>{@link #jauIr} initialize r-matrix to identity
16826     *     <li>{@link #jauRz} rotate around Z-axis
16827     *     <li>{@link #jauRy} rotate around Y-axis
16828     *     <li>{@link #jauRx} rotate around X-axis
16829     * </ul>
16830     *<p>Reference:
16831     *
16832     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
16833     *     IERS Technical Note No. 32, BKG (2004)
16834     *
16835     *@version 2009 December 17
16836     *
16837     *  @since Release 20101201
16838     *
16839     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16840     */
16841     public static double[][] jauPom00(double xp, double yp, double sp)
16842     {
16843 
16844     /* Construct the matrix. */
16845        double rpom[][] = new double[3][3];
16846        jauIr(rpom);
16847        jauRz(sp, rpom);
16848        jauRy(-xp, rpom);
16849        jauRx(-yp, rpom);
16850 
16851        return rpom;
16852 
16853         }
16854     
16855 
16856     /**
16857     *  P-vector addition.
16858     *
16859     *<p>This function is derived from the International Astronomical Union's
16860     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16861     *
16862     *<p>Status:  vector/matrix support function.
16863     *
16864     *<!-- Given: -->
16865     *     @param a         double[3]       first p-vector
16866     *     @param b         double[3]       second p-vector
16867     *
16868     *<!-- Returned: -->
16869     *     @return apb       double[3]        <u>returned</u> a + b
16870     *
16871     *  Note:
16872     *     It is permissible to re-use the same array for any of the
16873     *     arguments.
16874     *
16875     *@version 2008 November 18
16876     *
16877     *  @since Release 20101201
16878     *
16879     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16880     */
16881     public static double[] jauPpp(double a[] , double b[] )
16882     {
16883        double apb[] = new double[3]; 
16884        apb[0] = a[0] + b[0];
16885        apb[1] = a[1] + b[1];
16886        apb[2] = a[2] + b[2];
16887 
16888        return apb;
16889 
16890      }
16891     
16892 
16893     /**
16894     *  P-vector plus scaled p-vector.
16895     *
16896     *<p>This function is derived from the International Astronomical Union's
16897     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16898     *
16899     *<p>Status:  vector/matrix support function.
16900     *
16901     *<!-- Given: -->
16902     *     @param a       double[3]      first p-vector
16903     *     @param s       double         scalar (multiplier for b)
16904     *     @param b       double[3]      second p-vector
16905     *
16906     *<!-- Returned: -->
16907     *     @return apsb    double[3]       <u>returned</u> a + s*b
16908     *
16909     *  Note:
16910     *     It is permissible for any of a, b and apsb to be the same array.
16911     *
16912     *<p>Called:<ul>
16913     *     <li>{@link #jauSxp} multiply p-vector by scalar
16914     *     <li>{@link #jauPpp} p-vector plus p-vector
16915     * </ul>
16916     *@version 2008 November 18
16917     *
16918     *  @since Release 20101201
16919     *
16920     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16921     */
16922     static double[] jauPpsp(double a[] , double s, double b[]  )
16923     {
16924        double sb[] = new double[3], apsb[];
16925 
16926 
16927     /* s*b. */
16928        sb = jauSxp(s,b);
16929 
16930     /* a + s*b. */
16931        apsb = jauPpp(a, sb);
16932 
16933        return apsb;
16934 
16935         }
16936     
16937     /**
16938      * Precession correction terms.
16939      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
16940      * 
16941      * @since AIDA Stage 1
16942      */
16943     public static class PrecessionDeltaTerms {
16944         /**  precession correction in longitude  */
16945         public double dpsipr;
16946         /**  precession correction in obliquity */
16947         public double depspr;
16948         public PrecessionDeltaTerms(double dpsipr, double depspr) {
16949             this.dpsipr = dpsipr;
16950             this.depspr = depspr;
16951         }
16952     }
16953 
16954     /**
16955     *  Precession-rate part of the IAU 2000 precession-nutation models
16956     *  (part of MHB2000).
16957     *
16958     *<p>This function is derived from the International Astronomical Union's
16959     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16960     *
16961     *<p>Status:  canonical model.
16962     *
16963     *<!-- Given: -->
16964     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16965     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16966     *
16967     *<!-- Returned: -->
16968     *     @param dpsipr double    <u>returned</u> precession corrections (Notes 2,3)
16969     *     @param depspr double    <u>returned</u> precession corrections (Notes 2,3) 
16970     *
16971     * <p>Notes:
16972     * <ol>
16973     *
16974     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16975     *     convenient way between the two arguments.  For example,
16976     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16977     *     among others:
16978     *<pre>
16979     *            date1          date2
16980     *
16981     *         2450123.7           0.0       (JD method)
16982     *         2451545.0       -1421.3       (J2000 method)
16983     *         2400000.5       50123.2       (MJD method)
16984     *         2450123.5           0.2       (date &amp; time method)
16985     *</pre>
16986     *     The JD method is the most natural and convenient to use in
16987     *     cases where the loss of several decimal digits of resolution
16988     *     is acceptable.  The J2000 method is best matched to the way
16989     *     the argument is handled internally and will deliver the
16990     *     optimum resolution.  The MJD method and the date &amp; time methods
16991     *     are both good compromises between resolution and convenience.
16992     *
16993     * <li> The precession adjustments are expressed as "nutation
16994     *     components", corrections in longitude and obliquity with respect
16995     *     to the J2000.0 equinox and ecliptic.
16996     *
16997     * <li> Although the precession adjustments are stated to be with respect
16998     *     to Lieske et al. (1977), the MHB2000 model does not specify which
16999     *     set of Euler angles are to be used and how the adjustments are to
17000     *     be applied.  The most literal and straightforward procedure is to
17001     *     adopt the 4-rotation epsilon_0, psi_A, omega_A, xi_A option, and
17002     *     to add dpsipr to psi_A and depspr to both omega_A and eps_A.
17003     *
17004     * <li> This is an implementation of one aspect of the IAU 2000A nutation
17005     *     model, formally adopted by the IAU General Assembly in 2000,
17006     *     namely MHB2000 (Mathews et al. 2002).
17007     *
17008     *<p>References:
17009     *
17010     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B., "Expressions
17011     *     for the precession quantities based upon the IAU (1976) System of
17012     *     Astronomical Constants", Astron.Astrophys., 58, 1-16 (1977)
17013     *
17014     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A., "Modeling of nutation
17015     *     and precession   New nutation series for nonrigid Earth and
17016     *     insights into the Earth's interior", J.Geophys.Res., 107, B4,
17017     *     2002.  The MHB2000 code itself was obtained on 9th September 2002
17018     *     from ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
17019     *
17020     *    <p>Wallace, P.T., "Software for Implementing the IAU 2000
17021     *     Resolutions", in IERS Workshop 5.1 (2002).
17022     *
17023     *@version 2009 December 17
17024     *
17025     *  @since Release 20101201
17026     *
17027     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17028     */
17029     static PrecessionDeltaTerms jauPr00(double date1, double date2)
17030     {
17031        double t;
17032 
17033     /* Precession and obliquity corrections (radians per century) */
17034        final double PRECOR = -0.29965 * DAS2R,
17035                            OBLCOR = -0.02524 * DAS2R;
17036 
17037 
17038     /* Interval between fundamental epoch J2000.0 and given date (JC). */
17039        t = ((date1 - DJ00) + date2) / DJC;
17040 
17041     /* Precession rate contributions with respect to IAU 1976/80. */
17042        double dpsipr = PRECOR * t;
17043        double depspr = OBLCOR * t;
17044 
17045        return new PrecessionDeltaTerms(dpsipr, depspr);
17046 
17047         }
17048     
17049     /**
17050      * Euler Angles.
17051      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
17052      * 
17053      * @since AIDA Stage 1
17054      */
17055     public static class EulerAngles {
17056         /** 1st rotation: radians cw around z */
17057         public double zeta;
17058         /** 3rd rotation: radians cw around z */
17059         public double z;
17060         /** 2nd rotation: radians ccw around y */
17061         public double theta;
17062         public EulerAngles(double zeta, double z, double theta){
17063             this.zeta = zeta;
17064             this.z = z;
17065             this.theta = theta;
17066         }
17067     }
17068                    
17069     /**
17070     *  IAU 1976 precession model.
17071     *
17072     *  This function forms the three Euler angles which implement general
17073     *  precession between two epochs, using the IAU 1976 model (as for
17074     *  the FK5 catalog).
17075     *
17076     *<p>This function is derived from the International Astronomical Union's
17077     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17078     *
17079     *<p>Status:  canonical model.
17080     *
17081     *<!-- Given: -->
17082     *     @param ep01 double     TDB starting epoch (Note 1)
17083     *     @param ep02 double     TDB starting epoch (Note 1) 
17084     *     @param ep11 double     TDB ending epoch (Note 1)
17085     *     @param ep12 double     TDB ending epoch (Note 1) 
17086     *
17087     *<!-- Returned: -->
17088     *     @param zeta         double      <u>returned</u> 1st rotation: radians cw around z
17089     *     @param z            double      <u>returned</u> 3rd rotation: radians cw around z
17090     *     @param theta        double      <u>returned</u> 2nd rotation: radians ccw around y
17091     *
17092     * <p>Notes:
17093     * <ol>
17094     *
17095     * <li> The epochs ep01+ep02 and ep11+ep12 are Julian Dates, apportioned
17096     *     in any convenient way between the arguments epn1 and epn2.  For
17097     *     example, JD(TDB)=2450123.7 could be expressed in any of these
17098     *     ways, among others:
17099     *
17100     *             epn1          epn2
17101     *
17102     *         2450123.7           0.0       (JD method)
17103     *         2451545.0       -1421.3       (J2000 method)
17104     *         2400000.5       50123.2       (MJD method)
17105     *         2450123.5           0.2       (date &amp; time method)
17106     *</pre>
17107     *     The JD method is the most natural and convenient to use in cases
17108     *     where the loss of several decimal digits of resolution is
17109     *     acceptable.  The J2000 method is best matched to the way the
17110     *     argument is handled internally and will deliver the optimum
17111     *     optimum resolution.  The MJD method and the date &amp; time methods
17112     *     are both good compromises between resolution and convenience.
17113     *     The two epochs may be expressed using different methods, but at
17114     *     the risk of losing some resolution.
17115     *
17116     * <li> The accumulated precession angles zeta, z, theta are expressed
17117     *     through canonical polynomials which are valid only for a limited
17118     *     time span.  In addition, the IAU 1976 precession rate is known to
17119     *     be imperfect.  The absolute accuracy of the present formulation
17120     *     is better than 0.1 arcsec from 1960AD to 2040AD, better than
17121     *     1 arcsec from 1640AD to 2360AD, and remains below 3 arcsec for
17122     *     the whole of the period 500BC to 3000AD.  The errors exceed
17123     *     10 arcsec outside the range 1200BC to 3900AD, exceed 100 arcsec
17124     *     outside 4200BC to 5600AD and exceed 1000 arcsec outside 6800BC to
17125     *     8200AD.
17126     *
17127     * <li> The three angles are returned in the conventional order, which
17128     *     is not the same as the order of the corresponding Euler
17129     *     rotations.  The precession matrix is
17130     *     R_3(-z) x R_2(+theta) x R_3(-zeta).
17131     *
17132     *<p>Reference:
17133     *
17134     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282, equations
17135     *     (6) &amp; (7), p283.
17136     *
17137     *@version 2009 December 17
17138     *
17139     *  @since Release 20101201
17140     *
17141     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17142     */
17143     static EulerAngles jauPrec76(double ep01, double ep02, double ep11, double ep12)
17144     {
17145        double t0, t, tas2r, w;
17146 
17147 
17148     /* Interval between fundamental epoch J2000.0 and start epoch (JC). */
17149        t0 = ((ep01 - DJ00) + ep02) / DJC;
17150 
17151     /* Interval over which precession required (JC). */
17152        t = ((ep11 - ep01) + (ep12 - ep02)) / DJC;
17153 
17154     /* Euler angles. */
17155        tas2r = t * DAS2R;
17156        w = 2306.2181 + (1.39656 - 0.000139 * t0) * t0;
17157 
17158        double zeta = (w + ((0.30188 - 0.000344 * t0) + 0.017998 * t) * t) * tas2r;
17159 
17160        double z = (w + ((1.09468 + 0.000066 * t0) + 0.018203 * t) * t) * tas2r;
17161 
17162        double theta = ((2004.3109 + (-0.85330 - 0.000217 * t0) * t0)
17163               + ((-0.42665 - 0.000217 * t0) - 0.041833 * t) * t) * tas2r;
17164 
17165        return new EulerAngles(zeta, z, theta);
17166 
17167         }
17168     
17169 
17170     /**
17171     *  Discard velocity component of a pv-vector.
17172     *
17173     *<p>This function is derived from the International Astronomical Union's
17174     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17175     *
17176     *<p>Status:  vector/matrix support function.
17177     *
17178     *<!-- Given: -->
17179     *     @param pv       double[2][3]      pv-vector
17180     *
17181     *<!-- Returned: -->
17182     *     @return p        double[3]          <u>returned</u> p-vector
17183     *
17184     *<p>Called:<ul>
17185     *     <li>{@link #jauCp} copy p-vector
17186     * </ul>
17187     *@version 2008 May 11
17188     *
17189     *  @since Release 20101201
17190     *
17191     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17192     */
17193     public static double[] jauPv2p(double pv[][] )
17194     {
17195        double p[] = new double[3];
17196        jauCp(pv[0], p);
17197 
17198        return p;
17199 
17200         }
17201     
17202 
17203     /**
17204      * A position and velocity expressed in spherical polar coordinates.
17205      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
17206      * 
17207      * @since AIDA Stage 1
17208      */
17209     public static class SphericalPositionVelocity {
17210         public SphericalPosition pos;
17211         public SphericalPosition vel;
17212         public SphericalPositionVelocity( double theta, double phi, double r,
17213                 double td, double pd, double rd) {
17214             pos = new SphericalPosition(theta, phi, r);
17215             vel = new SphericalPosition(td,pd,rd);
17216         }
17217     }
17218     /**
17219     *  Convert position/velocity from Cartesian to spherical coordinates.
17220     *
17221     *<p>This function is derived from the International Astronomical Union's
17222     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17223     *
17224     *<p>Status:  vector/matrix support function.
17225     *
17226     *<!-- Given: -->
17227     *     @param pv        double[2][3]   pv-vector
17228     *
17229     *<!-- Returned: -->
17230     *     @return theta     double          <u>returned</u> longitude angle (radians)
17231     *             phi       double          <u>returned</u> latitude angle (radians)
17232     *             r         double          <u>returned</u> radial distance
17233     *             td        double          <u>returned</u> rate of change of theta
17234     *             pd        double          <u>returned</u> rate of change of phi
17235     *             rd        double          <u>returned</u> rate of change of r
17236     *
17237     * <p>Notes:
17238     * <ol>
17239     *
17240     * <li> If the position part of pv is null, theta, phi, td and pd
17241     *     are indeterminate.  This is handled by extrapolating the
17242     *     position through unit time by using the velocity part of
17243     *     pv.  This moves the origin without changing the direction
17244     *     of the velocity component.  If the position and velocity
17245     *     components of pv are both null, zeroes are returned for all
17246     *     six results.
17247     *
17248     * <li> If the position is a pole, theta, td and pd are indeterminate.
17249     *     In such cases zeroes are returned for all three.
17250     *</ol>
17251     *@version 2008 October 28
17252     *
17253     *  @since Release 20101201
17254     *
17255     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17256     */
17257     public static SphericalPositionVelocity jauPv2s(double pv[][])
17258     {
17259        double x, y, z, xd, yd, zd, rxy2, rxy, r2, rtrue, rw, xyp;
17260        double theta, phi, r, td, pd, rd;
17261 
17262     /* Components of position/velocity vector. */
17263        x  = pv[0][0];
17264        y  = pv[0][1];
17265        z  = pv[0][2];
17266        xd = pv[1][0];
17267        yd = pv[1][1];
17268        zd = pv[1][2];
17269 
17270     /* Component of r in XY plane squared. */
17271        rxy2 = x*x + y*y;
17272 
17273     /* Modulus squared. */
17274        r2 = rxy2 + z*z;
17275 
17276     /* Modulus. */
17277        rtrue = sqrt(r2);
17278 
17279     /* If null vector, move the origin along the direction of movement. */
17280        rw = rtrue;
17281        if (rtrue == 0.0) {
17282            x = xd;
17283            y = yd;
17284            z = zd;
17285            rxy2 = x*x + y*y;
17286            r2 = rxy2 + z*z;
17287            rw = sqrt(r2);
17288        }
17289 
17290     /* Position and velocity in spherical coordinates. */
17291        rxy = sqrt(rxy2);
17292        xyp = x*xd + y*yd;
17293        if (rxy2 != 0.0) {
17294            theta = atan2(y, x);
17295            phi = atan2(z, rxy);
17296            td = (x*yd - y*xd) / rxy2;
17297            pd = (zd*rxy2 - z*xyp) / (r2*rxy);
17298        } else {
17299            theta = 0.0;
17300            phi = (z != 0.0) ? atan2(z, rxy) : 0.0;
17301            td = 0.0;
17302            pd = 0.0;
17303        }
17304        r = rtrue;
17305        rd = (rw != 0.0) ? (xyp + z*zd) / rw : 0.0;
17306 
17307        return new SphericalPositionVelocity(theta, phi, r, td, pd, rd);
17308 
17309         }
17310     
17311 
17312     /**
17313     *  Inner (=scalar=dot) product of two pv-vectors.
17314     *
17315     *<p>This function is derived from the International Astronomical Union's
17316     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17317     *
17318     *<p>Status:  vector/matrix support function.
17319     *
17320     *<!-- Given: -->
17321     *     @param a         double[2][3]       first pv-vector
17322     *     @param b         double[2][3]       second pv-vector
17323     *
17324     *<!-- Returned: -->
17325     *     @return adb       double[2]           <u>returned</u> a . b (see note)
17326     *
17327     *  Note:
17328     *
17329     *     If the position and velocity components of the two pv-vectors are
17330     *     ( ap, av ) and ( bp, bv ), the result, a . b, is the pair of
17331     *     numbers ( ap . bp , ap . bv + av . bp ).  The two numbers are the
17332     *     dot-product of the two p-vectors and its derivative.
17333     *
17334     *<p>Called:<ul>
17335     *     <li>{@link #jauPdp} scalar product of two p-vectors
17336     * </ul>
17337     *@version 2008 May 22
17338     *
17339     *  @since Release 20101201
17340     *
17341     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17342     */
17343     public static double[] jauPvdpv(double a[][], double b[][] )
17344     {
17345        double adbd, addb, adb[] = new double[2];
17346 
17347 
17348     /* a . b = constant part of result. */
17349        adb[0] = jauPdp(a[0], b[0]);
17350 
17351     /* a . bdot */
17352        adbd = jauPdp(a[0], b[1]);
17353 
17354     /* adot . b */
17355        addb = jauPdp(a[1], b[0]);
17356 
17357     /* Velocity part of result. */
17358        adb[1] = adbd + addb;
17359 
17360        return adb;
17361 
17362         }
17363     
17364 
17365     /**
17366      * Modulus of pv-vector.
17367      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
17368      * 
17369      * @since AIDA Stage 1
17370      */
17371     public static class PVModulus{
17372         public double r;
17373         public double s;
17374         public PVModulus( double r, double s){
17375             this.r = r;
17376             this.s = s;
17377         }
17378     }
17379     /**
17380     *  Modulus of pv-vector.
17381     *
17382     *<p>This function is derived from the International Astronomical Union's
17383     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17384     *
17385     *<p>Status:  vector/matrix support function.
17386     *
17387     *<!-- Given: -->
17388     *     @param pv      double[2][3]    pv-vector
17389     *
17390     *<!-- Returned: -->
17391     *     @return           modulus of position component,
17392     *                      modulus of velocity component
17393     *
17394     *<p>Called:<ul>
17395     *     <li>{@link #jauPm} modulus of p-vector
17396     * </ul>
17397     *@version 2008 May 22
17398     *
17399     *  @since Release 20101201
17400     *
17401     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17402     */
17403     public static PVModulus jauPvm(double pv[][])
17404     {
17405     /* Distance. */
17406        double r = jauPm(pv[0]);
17407 
17408     /* Speed. */
17409        double s = jauPm(pv[1]);
17410 
17411        return new PVModulus(r, s);
17412 
17413         }
17414     
17415 
17416     /**
17417     *  Subtract one pv-vector from another.
17418     *
17419     *<p>This function is derived from the International Astronomical Union's
17420     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17421     *
17422     *<p>Status:  vector/matrix support function.
17423     *
17424     *<!-- Given: -->
17425     *     @param a        double[2][3]       first pv-vector
17426     *     @param b        double[2][3]       second pv-vector
17427     *
17428     *<!-- Returned: -->
17429     *     @return      double[2][3]        <u>returned</u> a - b
17430     *
17431     *  Note:
17432     *     It is permissible to re-use the same array for any of the
17433     *     arguments.
17434     *
17435     *<p>Called:<ul>
17436     *     <li>{@link #jauPmp} p-vector minus p-vector
17437     * </ul>
17438     *@version 2008 November 18
17439     *
17440     *  @since Release 20101201
17441     *
17442     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17443     */
17444     public static double[][] jauPvmpv(double a[][], double b[][])
17445     {
17446        double amb[][] = new double[2][3];
17447        amb[0] = jauPmp(a[0], b[0]);
17448        amb[1] = jauPmp(a[1], b[1]);
17449 
17450        return amb;
17451 
17452         }
17453     
17454 
17455     /**
17456     *  Add one pv-vector to another.
17457     *
17458     *<p>This function is derived from the International Astronomical Union's
17459     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17460     *
17461     *<p>Status:  vector/matrix support function.
17462     *
17463     *<!-- Given: -->
17464     *     @param a         double[2][3]       first pv-vector
17465     *     @param b         double[2][3]       second pv-vector
17466     *
17467     *<!-- Returned: -->
17468     *     @return apb       double[2][3]        <u>returned</u> a + b
17469     *
17470     *  Note:
17471     *     It is permissible to re-use the same array for any of the
17472     *     arguments.
17473     *
17474     *<p>Called:<ul>
17475     *     <li>{@link #jauPpp} p-vector plus p-vector
17476     * </ul>
17477     *@version 2008 November 18
17478     *
17479     *  @since Release 20101201
17480     *
17481     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17482     */
17483     public static double[][] jauPvppv(double a[][], double b[][])
17484     {
17485        double apb[][] = new double[2][3];
17486        apb[0] = jauPpp(a[0], b[0]);
17487        apb[1] = jauPpp(a[1], b[1]);
17488 
17489        return apb;
17490 
17491         }
17492     
17493 
17494     /**
17495      * Typical catalogue coordinates. i.e. Position, proper motion, parallax and radial velocity.
17496      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
17497      * 
17498      * @since AIDA Stage 1
17499      */
17500     public static class CatalogCoords {
17501         /** position (radians) */
17502         public SphericalCoordinate pos;
17503         /** proper motion (radians/year)*/
17504         public SphericalCoordinate pm;
17505         /** parallax (arcsec) */
17506         public double px;
17507         /** radial velocity (km/s, positive = receding) */
17508         public double rv;
17509         
17510         public CatalogCoords(double ra, double dec,
17511                 double pmr, double pmd, double px, double rv) {
17512             this.pos = new SphericalCoordinate(ra, dec);
17513             this.pm = new SphericalCoordinate(pmr, pmd);
17514             this.px = px;
17515             this.rv = rv;
17516         }
17517     }
17518     /**
17519     *  Convert star position+velocity vector to catalog coordinates.
17520     *
17521     *<p>This function is derived from the International Astronomical Union's
17522     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17523     *
17524     *<p>Status:  support function.
17525     *
17526     *  Given (Note 1):
17527     *    @param pv     double[2][3]   pv-vector (au, au/day)
17528     *
17529      *
17530     * <!-- Returned (function value): -->
17531     *  @return catalogue value
17532     *  
17533     * 
17534     * @throws    JSOFAInternalError  superluminal speed (Note 5), or null position vector
17535     *
17536     * <p>Notes:
17537     * <ol>
17538     *
17539     * <li> The specified pv-vector is the coordinate direction (and its rate
17540     *     of change) for the date at which the light leaving the star
17541     *     reached the solar-system barycenter.
17542     *
17543     * <li> The star data returned by this function are "observables" for an
17544     *     imaginary observer at the solar-system barycenter.  Proper motion
17545     *     and radial velocity are, strictly, in terms of barycentric
17546     *     coordinate time, TCB.  For most practical applications, it is
17547     *     permissible to neglect the distinction between TCB and ordinary
17548     *     "proper" time on Earth (TT/TAI).  The result will, as a rule, be
17549     *     limited by the intrinsic accuracy of the proper-motion and
17550     *     radial-velocity data;  moreover, the supplied pv-vector is likely
17551     *     to be merely an intermediate result (for example generated by the
17552     *     function jauStarpv), so that a change of time unit will cancel
17553     *     out overall.
17554     *
17555     *     In accordance with normal star-catalog conventions, the object's
17556     *     right ascension and declination are freed from the effects of
17557     *     secular aberration.  The frame, which is aligned to the catalog
17558     *     equator and equinox, is Lorentzian and centered on the SSB.
17559     *
17560     *     Summarizing, the specified pv-vector is for most stars almost
17561     *     identical to the result of applying the standard geometrical
17562     *     "space motion" transformation to the catalog data.  The
17563     *     differences, which are the subject of the Stumpff paper cited
17564     *     below, are:
17565     *
17566     *     (i) In stars with significant radial velocity and proper motion,
17567     *     the constantly changing light-time distorts the apparent proper
17568     *     motion.  Note that this is a classical, not a relativistic,
17569     *     effect.
17570     *
17571     *     (ii) The transformation complies with special relativity.
17572     *
17573     * <li> Care is needed with units.  The star coordinates are in radians
17574     *     and the proper motions in radians per Julian year, but the
17575     *     parallax is in arcseconds; the radial velocity is in km/s, but
17576     *     the pv-vector result is in au and au/day.
17577     *
17578     * <li> The proper motions are the rate of change of the right ascension
17579     *     and declination at the catalog epoch and are in radians per Julian
17580     *     year.  The RA proper motion is in terms of coordinate angle, not
17581     *     true angle, and will thus be numerically larger at high
17582     *     declinations.
17583     *
17584     * <li> Straight-line motion at constant speed in the inertial frame is
17585     *     assumed.  If the speed is greater than or equal to the speed of
17586     *     light, the function aborts with an error status.
17587     *
17588     * <li> The inverse transformation is performed by the function jauStarpv.
17589     *</ol>
17590     *<p>Called:<ul>
17591     *     <li>{@link #jauPn} decompose p-vector into modulus and direction
17592     *     <li>{@link #jauPdp} scalar product of two p-vectors
17593     *     <li>{@link #jauSxp} multiply p-vector by scalar
17594     *     <li>{@link #jauPmp} p-vector minus p-vector
17595     *     <li>{@link #jauPm} modulus of p-vector
17596     *     <li>{@link #jauPpp} p-vector plus p-vector
17597     *     <li>{@link #jauPv2s} pv-vector to spherical
17598     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
17599     * </ul>
17600     *<p>Reference:
17601     *
17602     *     Stumpff, P., 1985, Astron.Astrophys. 144, 232-240.
17603     *
17604     *@version 2023 May 4
17605     *
17606     *  @since Release 20101201
17607     *
17608     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17609     */
17610     public static CatalogCoords jauPvstar(double pv[][]) throws JSOFAInternalError
17611     {
17612        double x[] = new double[3], vr, ur[] = new double[3], vt, ut[] = new double[3], bett, betr, d, w, del,
17613               usr[] = new double[3], ust[] = new double[3];
17614 
17615 
17616     /* Isolate the radial component of the velocity (au/day, inertial). */
17617        NormalizedVector nv = jauPn(pv[0]);
17618        x = nv.u;
17619        vr = jauPdp(x, pv[1]);
17620        ur = jauSxp(vr,x);
17621 
17622     /* Isolate the transverse component of the velocity (au/day, inertial). */
17623        ut = jauPmp(pv[1], ur);
17624        vt = jauPm(ut);
17625 
17626     /* Special-relativity dimensionless parameters. */
17627        bett = vt / DC;
17628        betr = vr / DC;
17629 
17630     /* The inertial-to-observed correction terms. */
17631        d = 1.0 + betr;
17632        w = betr*betr + bett*bett;
17633        if (d == 0.0 || w > 1) throw new JSOFAInternalError("Superluminal speed", -1);
17634        del = -w / (sqrt(1.0 -w) + 1.0);
17635 
17636     /* Scale inertial tangential velocity vector into observed (au/d). */
17637        ust = jauSxp(1.0/d, ut);
17638 
17639     /* Compute observed radial velocity vector (au/d). */
17640        usr = jauSxp(DC*(betr-del)/d,x);
17641 
17642     /* Combine the two to obtain the observed velocity vector (au/day). */
17643        pv[1] = jauPpp(usr, ust);
17644 
17645     /* Cartesian to spherical. */
17646        SphericalPositionVelocity pvs = jauPv2s(pv);
17647        if (pvs.pos.r == 0.0) throw new JSOFAInternalError("null position vector", -2);
17648 
17649     /* Return RA in range 0 to 2pi. */
17650        double ra = jauAnp(pvs.pos.theta);
17651 
17652     /* Return proper motions in radians per year. */
17653        double pmr = pvs.vel.theta * DJY;
17654        double pmd = pvs.vel.phi * DJY;
17655 
17656     /* Return parallax in arcsec. */
17657        double px = DR2AS / pvs.pos.r;
17658 
17659     /* Return radial velocity in km/s. */
17660        double rv = 1e-3 * pvs.vel.r * DAU / DAYSEC;
17661 
17662     /* OK status. */
17663        return new CatalogCoords(ra, pvs.pos.phi, pmr, pmd, px, rv);
17664 
17665         }
17666     
17667 
17668     /**
17669     *  Update a pv-vector.
17670     *
17671     *<p>This function is derived from the International Astronomical Union's
17672     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17673     *
17674     *<p>Status:  vector/matrix support function.
17675     *
17676     *<!-- Given: -->
17677     *     @param dt        double            time interval
17678     *     @param pv        double[2][3]      pv-vector
17679     *
17680     *<!-- Returned: -->
17681     *     @return upv       double[2][3]       <u>returned</u> p updated, v unchanged
17682     *
17683     * <p>Notes:
17684     * <ol>
17685     *
17686     * <li> "Update" means "refer the position component of the vector
17687     *     to a new date dt time units from the existing date".
17688     *
17689     * <li> The time units of dt must match those of the velocity.
17690     *
17691     * <li> It is permissible for pv and upv to be the same array.
17692     *</ol>
17693     *<p>Called:<ul>
17694     *     <li>{@link #jauPpsp} p-vector plus scaled p-vector
17695     *     <li>{@link #jauCp} copy p-vector
17696     * </ul>
17697     *@version 2008 November 17
17698     *
17699     *  @since Release 20101201
17700     *
17701     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17702     */
17703     public static double[][] jauPvu(double dt, double pv[][] )
17704     {
17705        double upv[][] = new double[2][3];
17706        upv[0] = jauPpsp(pv[0], dt, pv[1]);
17707        jauCp(pv[1], upv[1]);
17708 
17709        return upv;
17710 
17711         }
17712     
17713 
17714     /**
17715     *  Update a pv-vector, discarding the velocity component.
17716     *
17717     *<p>This function is derived from the International Astronomical Union's
17718     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17719     *
17720     *<p>Status:  vector/matrix support function.
17721     *
17722     *<!-- Given: -->
17723     *     @param dt        double             time interval
17724     *     @param pv        double[2][3]       pv-vector
17725     *
17726     *<!-- Returned: -->
17727     *     @return p         double[3]           <u>returned</u> p-vector
17728     *
17729     * <p>Notes:
17730     * <ol>
17731     *
17732     * <li> "Update" means "refer the position component of the vector to a
17733     *     new date dt time units from the existing date".
17734     *
17735     * <li> The time units of dt must match those of the velocity.
17736     *</ol>
17737     *@version 2008 May 11
17738     *
17739     *  @since Release 20101201
17740     *
17741     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17742     */
17743     public static double[] jauPvup(double dt, double pv[][] )
17744     {
17745         double p[] = new double[3];
17746        p[0] = pv[0][0] + dt * pv[1][0];
17747        p[1] = pv[0][1] + dt * pv[1][1];
17748        p[2] = pv[0][2] + dt * pv[1][2];
17749 
17750        return p;
17751 
17752         }
17753     
17754 
17755     /**
17756     *  Outer (=vector=cross) product of two pv-vectors.
17757     *
17758     *<p>This function is derived from the International Astronomical Union's
17759     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17760     *
17761     *<p>Status:  vector/matrix support function.
17762     *
17763     *<!-- Given: -->
17764     *     @param a         double[2][3]       first pv-vector
17765     *     @param b         double[2][3]       second pv-vector
17766     *
17767     *<!-- Returned: -->
17768     *     @return axb       double[2][3]        <u>returned</u> a x b
17769     *
17770     * <p>Notes:
17771     * <ol>
17772     *
17773     * <li> If the position and velocity components of the two pv-vectors are
17774     *     ( ap, av ) and ( bp, bv ), the result, a x b, is the pair of
17775     *     vectors ( ap x bp, ap x bv + av x bp ).  The two vectors are the
17776     *     cross-product of the two p-vectors and its derivative.
17777     *
17778     * <li> It is permissible to re-use the same array for any of the
17779     *     arguments.
17780     *</ol>
17781     *<p>Called:<ul>
17782     *     <li>{@link #jauCpv} copy pv-vector
17783     *     <li>{@link #jauPxp} vector product of two p-vectors
17784     *     <li>{@link #jauPpp} p-vector plus p-vector
17785     * </ul>
17786     *@version 2008 November 18
17787     *
17788     *  @since Release 20101201
17789     *
17790     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17791     */
17792     public static double[][] jauPvxpv(double a[][], double b[][] )
17793     {
17794        double wa[][] = new double[2][3], wb[][] = new double[2][3], axbd[] = new double[3], adxb[] = new double[3];
17795 
17796        double axb[][] = new double[2][3];
17797     /* Make copies of the inputs. */
17798        jauCpv(a, wa);
17799        jauCpv(b, wb);
17800 
17801     /* a x b = position part of result. */
17802        axb[0] = jauPxp(wa[0], wb[0]);
17803 
17804     /* a x bdot + adot x b = velocity part of result. */
17805        axbd = jauPxp(wa[0],wb[1]);
17806        adxb = jauPxp(wa[1],wb[0]);
17807        axb[1] = jauPpp(axbd, adxb);
17808 
17809        return axb;
17810 
17811         }
17812     
17813 
17814     /**
17815     *  p-vector outer (=vector=cross) product.
17816     *
17817     *<p>This function is derived from the International Astronomical Union's
17818     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17819     *
17820     *<p>Status:  vector/matrix support function.
17821     *
17822     *<!-- Given: -->
17823     *     @param a         double[3]       first p-vector
17824     *     @param b         double[3]       second p-vector
17825     *
17826     *<!-- Returned: -->
17827     *     @return axb       double[3]        <u>returned</u> a x b
17828     *
17829     *  Note:
17830     *     It is permissible to re-use the same array for any of the
17831     *     arguments.
17832     *
17833     *@version 2008 November 18
17834     *
17835     *  @since Release 20101201
17836     *
17837     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17838     */
17839     public static double[] jauPxp(double a[] , double b[]  )
17840     {
17841        double xa, ya, za, xb, yb, zb;
17842        double axb[] = new double[3];
17843 
17844        xa = a[0];
17845        ya = a[1];
17846        za = a[2];
17847        xb = b[0];
17848        yb = b[1];
17849        zb = b[2];
17850        axb[0] = ya*zb - za*yb;
17851        axb[1] = za*xb - xa*zb;
17852        axb[2] = xa*yb - ya*xb;
17853 
17854        return axb;
17855 
17856         }
17857     
17858 
17859     /**
17860     *  Express an r-matrix as an r-vector.
17861     *
17862     *<p>This function is derived from the International Astronomical Union's
17863     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17864     *
17865     *<p>Status:  vector/matrix support function.
17866     *
17867     *<!-- Given: -->
17868     *     @param r         double[3][3]     rotation matrix
17869     *
17870     *<!-- Returned: -->
17871     *     @return w         double[3]         <u>returned</u> rotation vector (Note 1)
17872     *
17873     * <p>Notes:
17874     * <ol>
17875     *
17876     * <li> A rotation matrix describes a rotation through some angle about
17877     *     some arbitrary axis called the Euler axis.  The "rotation vector"
17878     *     returned by this function has the same direction as the Euler axis,
17879     *     and its magnitude is the angle in radians.  (The magnitude and
17880     *     direction can be separated by means of the function jauPn.)
17881     *
17882     * <li> If r is null, so is the result.  If r is not a rotation matrix
17883     *     the result is undefined;  r must be proper (i.e. have a positive
17884     *     determinant) and real orthogonal (inverse = transpose).
17885     *
17886     * <li> The reference frame rotates clockwise as seen looking along
17887     *     the rotation vector from the origin.
17888     *</ol>
17889     *@version 2008 May 12
17890     *
17891     *  @since Release 20101201
17892     *
17893     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17894     */
17895     public static double[] jauRm2v(double r[][] )
17896     {
17897        double x, y, z, s2, c2, phi, f;
17898        double w[] = new double[3];
17899 
17900        x = r[1][2] - r[2][1];
17901        y = r[2][0] - r[0][2];
17902        z = r[0][1] - r[1][0];
17903        s2 = sqrt(x*x + y*y + z*z);
17904        if (s2 > 0) {
17905           c2 = r[0][0] + r[1][1] + r[2][2] - 1;
17906           phi = atan2(s2, c2);
17907           f =  phi / s2;
17908           w[0] = x * f;
17909           w[1] = y * f;
17910           w[2] = z * f;
17911        } else {
17912           w[0] = 0.0;
17913           w[1] = 0.0;
17914           w[2] = 0.0;
17915        }
17916 
17917        return w;
17918 
17919         }
17920     
17921 
17922     /**
17923     *  Form the r-matrix corresponding to a given r-vector.
17924     *
17925     *<p>This function is derived from the International Astronomical Union's
17926     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17927     *
17928     *<p>Status:  vector/matrix support function.
17929     *
17930     *<!-- Given: -->
17931     *     @param w         double[3]       rotation vector (Note 1)
17932     *
17933     *<!-- Returned: -->
17934     *     @return r         double[3][3]      <u>returned</u> rotation matrix
17935     *
17936     * <p>Notes:
17937     * <ol>
17938     *
17939     * <li> A rotation matrix describes a rotation through some angle about
17940     *     some arbitrary axis called the Euler axis.  The "rotation vector"
17941     *     supplied to This function has the same direction as the Euler
17942     *     axis, and its magnitude is the angle in radians.
17943     *
17944     * <li> If w is null, the identity matrix is returned.
17945     *
17946     * <li> The reference frame rotates clockwise as seen looking along the
17947     *     rotation vector from the origin.
17948     *</ol>
17949     *@version 2008 May 11
17950     *
17951     *  @since Release 20101201
17952     *
17953     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17954     */
17955     public static double[][] jauRv2m(double w[])
17956     {
17957        double x, y, z, phi, s, c, f;
17958        double r[][] = new double[3][3];
17959 
17960 
17961     /* Euler angle (magnitude of rotation vector) and functions. */
17962        x = w[0];
17963        y = w[1];
17964        z = w[2];
17965        phi = sqrt(x*x + y*y + z*z);
17966        s = sin(phi);
17967        c = cos(phi);
17968        f = 1.0 - c;
17969 
17970     /* Euler axis (direction of rotation vector), perhaps null. */
17971        if (phi > 0.0) {
17972            x /= phi;
17973            y /= phi;
17974            z /= phi;
17975        }
17976 
17977     /* Form the rotation matrix. */
17978        r[0][0] = x*x*f + c;
17979        r[0][1] = x*y*f + z*s;
17980        r[0][2] = x*z*f - y*s;
17981        r[1][0] = y*x*f - z*s;
17982        r[1][1] = y*y*f + c;
17983        r[1][2] = y*z*f + x*s;
17984        r[2][0] = z*x*f + y*s;
17985        r[2][1] = z*y*f - x*s;
17986        r[2][2] = z*z*f + c;
17987 
17988        return r;
17989 
17990         }
17991     
17992 
17993     /**
17994     *  Rotate an r-matrix about the x-axis.
17995     *
17996     *<p>This function is derived from the International Astronomical Union's
17997     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17998     *
17999     *<p>Status:  vector/matrix support function.
18000     *
18001     *<!-- Given: -->
18002     *     @param phi     double           angle (radians)
18003     *
18004     *  Given and returned:
18005     *      @param r      double[3][3]    r-matrix <u>given and returned</u>
18006     *
18007     *  Sign convention:  The matrix can be used to rotate the reference
18008     *  frame of a vector.  Calling this function with positive phi
18009     *  incorporates in the matrix an additional rotation, about the x-axis,
18010     *  anticlockwise as seen looking towards the origin from positive x.
18011     *
18012     *<p>Called:<ul>
18013     *     <li>{@link #jauIr} initialize r-matrix to identity
18014     *     <li>{@link #jauRxr} product of two r-matrices
18015     *     <li>{@link #jauCr} copy r-matrix
18016     * </ul>
18017     *@version 2008 May 22
18018     *
18019     *  @since Release 20101201
18020     *
18021     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18022     */
18023     public static void jauRx(double phi, double r[][])
18024     {
18025        double s, c, a[][] = new double[3][3], w[][];
18026 
18027 
18028     /* Matrix representing new rotation. */
18029        s = sin(phi);
18030        c = cos(phi);
18031        jauIr(a);
18032        a[1][1] =  c;
18033        a[2][1] = -s;
18034        a[1][2] =  s;
18035        a[2][2] =  c;
18036 
18037     /* Rotate. */
18038        w = jauRxr(a, r);
18039 
18040     /* Return result. */
18041        jauCr(w, r);
18042 
18043        return;
18044 
18045         }
18046     
18047 
18048     /**
18049     *  Multiply a p-vector by an r-matrix.
18050     *
18051     *<p>This function is derived from the International Astronomical Union's
18052     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18053     *
18054     *<p>Status:  vector/matrix support function.
18055     *
18056     *<!-- Given: -->
18057     *     @param r         double[3][3]     r-matrix
18058     *     @param p         double[3]        p-vector
18059     *
18060     *<!-- Returned: -->
18061     *     @return rp        double[3]         <u>returned</u> r * p
18062     *
18063     *  Note:
18064     *  <ol>
18065     *    <li> The algorithm is for the simple case where the r-matrix r is not
18066     *     a function of time.  The case where r is a function of time leads
18067     *    to an additional velocity component equal to the product of the
18068     *    derivative of r and the position vector.
18069     *
18070     *    <li> It is permissible for p and rp to be the same array.
18071     *  </ol>
18072     *
18073     *<p>Called:<ul>
18074     *     <li>{@link #jauCp} copy p-vector
18075     * </ul>
18076     *@version 2008 October 28
18077     *
18078     *  @since Release 20101201
18079     *
18080     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18081     */
18082     public static double[] jauRxp(double r[][], double p[])
18083     {
18084        double w, wrp[] = new double[3] ;
18085        int i, j;
18086 
18087 
18088     /* Matrix r * vector p. */
18089        for (j = 0; j < 3; j++) {
18090            w = 0.0;
18091            for (i = 0; i < 3; i++) {
18092                w += r[j][i] * p[i];
18093            }
18094            wrp[j] = w;
18095        }
18096 
18097 
18098        return wrp;
18099 
18100         }
18101     
18102 
18103     /**
18104     *  Multiply a pv-vector by an r-matrix.
18105     *
18106     *<p>This function is derived from the International Astronomical Union's
18107     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18108     *
18109     *<p>Status:  vector/matrix support function.
18110     *
18111     *<!-- Given: -->
18112     *     @param r         double[3][3]     r-matrix
18113     *     @param pv        double[2][3]     pv-vector
18114     *
18115     *<!-- Returned: -->
18116     *     @return rpv       double[2][3]      <u>returned</u> r * pv
18117     *
18118     *  Note:
18119     *     It is permissible for pv and rpv to be the same array.
18120     *
18121     *<p>Called:<ul>
18122     *     <li>{@link #jauRxp} product of r-matrix and p-vector
18123     * </ul>
18124     *@version 2008 October 28
18125     *
18126     *  @since Release 20101201
18127     *
18128     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18129     */
18130     public static double[][] jauRxpv(double r[][], double pv[][])
18131     {
18132        double rpv[][] = new double[2][0];
18133        rpv[0] = jauRxp(r, pv[0]);
18134        rpv[1] = jauRxp(r, pv[1]);
18135 
18136        return rpv;
18137 
18138         }
18139     
18140 
18141     /**
18142     *  Multiply two r-matrices.
18143     *
18144     *<p>This function is derived from the International Astronomical Union's
18145     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18146     *
18147     *<p>Status:  vector/matrix support function.
18148     *
18149     *<!-- Given: -->
18150     *     @param a         double[3][3]     first r-matrix
18151     *     @param b         double[3][3]     second r-matrix
18152     *
18153     *<!-- Returned: -->
18154     *     @return atb       double[3][3]      <u>returned</u> a * b
18155     *
18156     *  Note:
18157     *     It is permissible to re-use the same array for any of the
18158     *     arguments.
18159     *
18160     *<p>Called:<ul>
18161     *     <li>{@link #jauCr} copy r-matrix
18162     * </ul>
18163     *@version 2008 November 18
18164     *
18165     *  @since Release 20101201
18166     *
18167     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18168     */
18169     public static double[][] jauRxr(double a[][], double b[][])
18170     {
18171        int i, j, k;
18172        double w, wm[][] = new double[3][3];
18173 
18174 
18175        for (i = 0; i < 3; i++) {
18176           for (j = 0; j < 3; j++) {
18177              w = 0.0;
18178              for (k = 0; k < 3; k++) {
18179                 w +=  a[i][k] * b[k][j];
18180              }
18181              wm[i][j] = w;
18182           }
18183        }
18184 
18185        return wm;
18186 
18187      }
18188     
18189 
18190     /**
18191     *  Rotate an r-matrix about the y-axis.
18192     *
18193     *<p>This function is derived from the International Astronomical Union's
18194     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18195     *
18196     *<p>Status:  vector/matrix support function.
18197     *
18198     *<!-- Given: -->
18199     *     @param theta   double           angle (radians)
18200     *
18201     *  Given and returned:
18202     *     @param r      double[3][3]   <u>given &amp; returned</u> r-matrix
18203     *
18204     *  Sign convention:  The matrix can be used to rotate the reference
18205     *  frame of a vector.  Calling This function with positive theta
18206     *  incorporates in the matrix an additional rotation, about the y-axis,
18207     *  anticlockwise as seen looking towards the origin from positive y.
18208     *
18209     *<p>Called:<ul>
18210     *     <li>{@link #jauIr} initialize r-matrix to identity
18211     *     <li>{@link #jauRxr} product of two r-matrices
18212     *     <li>{@link #jauCr} copy r-matrix
18213     * </ul>
18214     *@version 2008 May 22
18215     *
18216     *  @since Release 20101201
18217     *
18218     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18219     */
18220     public static void jauRy(double theta, double r[][])
18221     {
18222        double s, c, a[][] = new double[3][3], w[][];
18223 
18224 
18225     /* Matrix representing new rotation. */
18226        s = sin(theta);
18227        c = cos(theta);
18228        jauIr(a);
18229        a[0][0] =  c;
18230        a[2][0] =  s;
18231        a[0][2] = -s;
18232        a[2][2] =  c;
18233 
18234     /* Rotate. */
18235        w = jauRxr(a, r);
18236 
18237     /* Return result. */
18238        jauCr(w, r);
18239 
18240        return;
18241 
18242         }
18243     
18244 
18245     /**
18246     *  Rotate an r-matrix about the z-axis.
18247     *
18248     *<p>This function is derived from the International Astronomical Union's
18249     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18250     *
18251     *<p>Status:  vector/matrix support function.
18252     *
18253     *<!-- Given: -->
18254     *     @param psi     double           angle (radians)
18255     *
18256     *  Given and returned:
18257     *     @param r      double[3][3]    <u>given &amp; retuned</u>r-matrix, rotated
18258     *
18259     *  Sign convention:  The matrix can be used to rotate the reference
18260     *  frame of a vector.  Calling This function with positive psi
18261     *  incorporates in the matrix an additional rotation, about the z-axis,
18262     *  anticlockwise as seen looking towards the origin from positive z.
18263     *
18264     *<p>Called:<ul>
18265     *     <li>{@link #jauIr} initialize r-matrix to identity
18266     *     <li>{@link #jauRxr} product of two r-matrices
18267     *     <li>{@link #jauCr} copy r-matrix
18268     * </ul>
18269     *@version 2008 May 22
18270     *
18271     *  @since Release 20101201
18272     *
18273     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18274     */
18275     public static void jauRz(double psi, double r[][])
18276     {
18277        double s, c, a[][] = new double[3][3], w[][];
18278 
18279 
18280     /* Matrix representing new rotation. */
18281        s = sin(psi);
18282        c = cos(psi);
18283        jauIr(a);
18284        a[0][0] =  c;
18285        a[1][0] = -s;
18286        a[0][1] =  s;
18287        a[1][1] =  c;
18288 
18289     /* Rotate. */
18290        w = jauRxr(a, r);
18291 
18292     /* Return result. */
18293        jauCr(w, r);
18294 
18295        return;
18296 
18297         }
18298     
18299 
18300     /**
18301     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18302     *  the equator of the Celestial Intermediate Pole, given the CIP's X,Y
18303     *  coordinates.  Compatible with IAU 2000A precession-nutation.
18304     *
18305     *<p>This function is derived from the International Astronomical Union's
18306     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18307     *
18308     *<p>Status:  canonical model.
18309     *
18310     *<!-- Given: -->
18311     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18312     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18313     *     @param x double     CIP coordinates (Note 3)
18314     *     @param y double     CIP coordinates (Note 3) 
18315     *
18316     * <!-- Returned (function value): -->
18317     *  @return double    the CIO locator s in radians (Note 2)
18318     *
18319     * <p>Notes:
18320     * <ol>
18321     *
18322     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18323     *     convenient way between the two arguments.  For example,
18324     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18325     *     among others:
18326     *<pre>
18327     *            date1          date2
18328     *
18329     *         2450123.7           0.0       (JD method)
18330     *         2451545.0       -1421.3       (J2000 method)
18331     *         2400000.5       50123.2       (MJD method)
18332     *         2450123.5           0.2       (date &amp; time method)
18333     *</pre>
18334     *     The JD method is the most natural and convenient to use in
18335     *     cases where the loss of several decimal digits of resolution
18336     *     is acceptable.  The J2000 method is best matched to the way
18337     *     the argument is handled internally and will deliver the
18338     *     optimum resolution.  The MJD method and the date &amp; time methods
18339     *     are both good compromises between resolution and convenience.
18340     *
18341     * <li> The CIO locator s is the difference between the right ascensions
18342     *     of the same point in two systems:  the two systems are the GCRS
18343     *     and the CIP,CIO, and the point is the ascending node of the
18344     *     CIP equator.  The quantity s remains below 0.1 arcsecond
18345     *     throughout 1900-2100.
18346     *
18347     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18348     *     are the x and y components of the CIP unit vector;  this series
18349     *     is more compact than a direct series for s would be.  This
18350     *     function requires X,Y to be supplied by the caller, who is
18351     *     responsible for providing values that are consistent with the
18352     *     supplied date.
18353     *
18354     * <li> The model is consistent with the IAU 2000A precession-nutation.
18355     *</ol>
18356     *<p>Called:<ul>
18357     *     <li>{@link #jauFal03} mean anomaly of the Moon
18358     *     <li>{@link #jauFalp03} mean anomaly of the Sun
18359     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
18360     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
18361     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
18362     *     <li>{@link #jauFave03} mean longitude of Venus
18363     *     <li>{@link #jauFae03} mean longitude of Earth
18364     *     <li>{@link #jauFapa03} general accumulated precession in longitude
18365     * </ul>
18366     *<p>References:
18367     *
18368     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
18369     *     "Expressions for the Celestial Intermediate Pole and Celestial
18370     *     Ephemeris Origin consistent with the IAU 2000A precession-
18371     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
18372     *
18373     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
18374     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
18375     *
18376     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
18377     *     IERS Technical Note No. 32, BKG (2004)
18378     *
18379     *@version 2010 January 18
18380     *
18381     *  @since Release 20101201
18382     *
18383     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18384     */
18385     public static double jauS00(double date1, double date2, double x, double y)
18386     {
18387     /* Time since J2000.0, in Julian centuries */
18388        double t;
18389 
18390     /* Miscellaneous */
18391        int i, j;
18392        double a, w0, w1, w2, w3, w4, w5;
18393 
18394     /* Fundamental arguments */
18395        double fa[] = new double[8];
18396 
18397     /* Returned value */
18398        double s;
18399 
18400     /* --------------------- */
18401     /* The series for s+XY/2 */
18402     /* --------------------- */
18403 
18404     /* Polynomial coefficients */
18405        final double sp[] = {
18406 
18407        /* 1-6 */
18408               94.00e-6,
18409             3808.35e-6,
18410             -119.94e-6,
18411           -72574.09e-6,
18412               27.70e-6,
18413               15.61e-6
18414        };
18415 
18416     /* Terms of order t^0 */
18417        final TERM s0[] = {
18418 
18419        /* 1-10 */
18420           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0}, -2640.73e-6,   0.39e-6 ),
18421           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},   -63.53e-6,   0.02e-6 ),
18422           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},   -11.75e-6,  -0.01e-6 ),
18423           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},   -11.21e-6,  -0.01e-6 ),
18424           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},     4.57e-6,   0.00e-6 ),
18425           new TERM(new int[]{ 0,  0,  2,  0,  3,  0,  0,  0},    -2.02e-6,   0.00e-6 ),
18426           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},    -1.98e-6,   0.00e-6 ),
18427           new TERM(new int[]{ 0,  0,  0,  0,  3,  0,  0,  0},     1.72e-6,   0.00e-6 ),
18428           new TERM(new int[]{ 0,  1,  0,  0,  1,  0,  0,  0},     1.41e-6,   0.01e-6 ),
18429           new TERM(new int[]{ 0,  1,  0,  0, -1,  0,  0,  0},     1.26e-6,   0.01e-6 ),
18430 
18431        /* 11-20 */
18432           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18433           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18434           new TERM(new int[]{ 0,  1,  2, -2,  3,  0,  0,  0},    -0.46e-6,   0.00e-6 ),
18435           new TERM(new int[]{ 0,  1,  2, -2,  1,  0,  0,  0},    -0.45e-6,   0.00e-6 ),
18436           new TERM(new int[]{ 0,  0,  4, -4,  4,  0,  0,  0},    -0.36e-6,   0.00e-6 ),
18437           new TERM(new int[]{ 0,  0,  1, -1,  1, -8, 12,  0},     0.24e-6,   0.12e-6 ),
18438           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.32e-6,   0.00e-6 ),
18439           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.28e-6,   0.00e-6 ),
18440           new TERM(new int[]{ 1,  0,  2,  0,  3,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18441           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
18442 
18443        /* 21-30 */
18444           new TERM(new int[]{ 0,  0,  2, -2,  0,  0,  0,  0},     0.21e-6,   0.00e-6 ),
18445           new TERM(new int[]{ 0,  1, -2,  2, -3,  0,  0,  0},    -0.19e-6,   0.00e-6 ),
18446           new TERM(new int[]{ 0,  1, -2,  2, -1,  0,  0,  0},    -0.18e-6,   0.00e-6 ),
18447           new TERM(new int[]{ 0,  0,  0,  0,  0,  8,-13, -1},     0.10e-6,  -0.05e-6 ),
18448           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.15e-6,   0.00e-6 ),
18449           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18450           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18451           new TERM(new int[]{ 1,  0,  0, -2,  1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18452           new TERM(new int[]{ 1,  0,  0, -2, -1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18453           new TERM(new int[]{ 0,  0,  4, -2,  4,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
18454 
18455        /* 31-33 */
18456           new TERM(new int[]{ 0,  0,  2, -2,  4,  0,  0,  0},     0.11e-6,   0.00e-6 ),
18457           new TERM(new int[]{ 1,  0, -2,  0, -3,  0,  0,  0},    -0.11e-6,   0.00e-6 ),
18458           new TERM(new int[]{ 1,  0, -2,  0, -1,  0,  0,  0},    -0.11e-6,   0.00e-6 )
18459        };
18460 
18461     /* Terms of order t^1 */
18462        final TERM s1[] ={
18463 
18464        /* 1-3 */
18465           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -0.07e-6,   3.57e-6 ),
18466           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     1.71e-6,  -0.03e-6 ),
18467           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},     0.00e-6,   0.48e-6 )
18468        };
18469 
18470     /* Terms of order t^2 */
18471        final TERM s2[] ={
18472 
18473        /* 1-10 */
18474           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},   743.53e-6,  -0.17e-6 ),
18475           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    56.91e-6,   0.06e-6 ),
18476           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},     9.84e-6,  -0.01e-6 ),
18477           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -8.85e-6,   0.01e-6 ),
18478           new TERM(new int[]{ 0,  1,  0,  0,  0,  0,  0,  0},    -6.38e-6,  -0.05e-6 ),
18479           new TERM(new int[]{ 1,  0,  0,  0,  0,  0,  0,  0},    -3.07e-6,   0.00e-6 ),
18480           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     2.23e-6,   0.00e-6 ),
18481           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},     1.67e-6,   0.00e-6 ),
18482           new TERM(new int[]{ 1,  0,  2,  0,  2,  0,  0,  0},     1.30e-6,   0.00e-6 ),
18483           new TERM(new int[]{ 0,  1, -2,  2, -2,  0,  0,  0},     0.93e-6,   0.00e-6 ),
18484 
18485        /* 11-20 */
18486           new TERM(new int[]{ 1,  0,  0, -2,  0,  0,  0,  0},     0.68e-6,   0.00e-6 ),
18487           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},    -0.55e-6,   0.00e-6 ),
18488           new TERM(new int[]{ 1,  0, -2,  0, -2,  0,  0,  0},     0.53e-6,   0.00e-6 ),
18489           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18490           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18491           new TERM(new int[]{ 1,  0, -2, -2, -2,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
18492           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},    -0.25e-6,   0.00e-6 ),
18493           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},     0.22e-6,   0.00e-6 ),
18494           new TERM(new int[]{ 2,  0,  0, -2,  0,  0,  0,  0},    -0.21e-6,   0.00e-6 ),
18495           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.20e-6,   0.00e-6 ),
18496 
18497        /* 21-25 */
18498           new TERM(new int[]{ 0,  0,  2,  2,  2,  0,  0,  0},     0.17e-6,   0.00e-6 ),
18499           new TERM(new int[]{ 2,  0,  2,  0,  2,  0,  0,  0},     0.13e-6,   0.00e-6 ),
18500           new TERM(new int[]{ 2,  0,  0,  0,  0,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
18501           new TERM(new int[]{ 1,  0,  2, -2,  2,  0,  0,  0},    -0.12e-6,   0.00e-6 ),
18502           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.11e-6,   0.00e-6 )
18503        };
18504 
18505     /* Terms of order t^3 */
18506        final TERM s3[] ={
18507 
18508        /* 1-4 */
18509           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     0.30e-6, -23.51e-6 ),
18510           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    -0.03e-6,  -1.39e-6 ),
18511           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.01e-6,  -0.24e-6 ),
18512           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},     0.00e-6,   0.22e-6 )
18513        };
18514 
18515     /* Terms of order t^4 */
18516        final TERM s4[] ={
18517 
18518        /* 1-1 */
18519           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},    -0.26e-6,  -0.01e-6 )
18520        };
18521 
18522     /* Number of terms in the series */
18523        final int NS0 = s0.length;
18524        final int NS1 = s1.length;
18525        final int NS2 = s2.length;
18526        final int NS3 = s3.length;
18527        final int NS4 = s4.length;
18528 
18529     /*--------------------------------------------------------------------*/
18530 
18531     /* Interval between fundamental epoch J2000.0 and current date (JC). */
18532        t = ((date1 - DJ00) + date2) / DJC;
18533 
18534     /* Fundamental Arguments (from IERS Conventions 2003) */
18535 
18536     /* Mean anomaly of the Moon. */
18537        fa[0] = jauFal03(t);
18538 
18539     /* Mean anomaly of the Sun. */
18540        fa[1] = jauFalp03(t);
18541 
18542     /* Mean longitude of the Moon minus that of the ascending node. */
18543        fa[2] = jauFaf03(t);
18544 
18545     /* Mean elongation of the Moon from the Sun. */
18546        fa[3] = jauFad03(t);
18547 
18548     /* Mean longitude of the ascending node of the Moon. */
18549        fa[4] = jauFaom03(t);
18550 
18551     /* Mean longitude of Venus. */
18552        fa[5] = jauFave03(t);
18553 
18554     /* Mean longitude of Earth. */
18555        fa[6] = jauFae03(t);
18556 
18557     /* General precession in longitude. */
18558        fa[7] = jauFapa03(t);
18559 
18560     /* Evaluate s. */
18561        w0 = sp[0];
18562        w1 = sp[1];
18563        w2 = sp[2];
18564        w3 = sp[3];
18565        w4 = sp[4];
18566        w5 = sp[5];
18567 
18568        for (i = NS0-1; i >= 0; i--) {
18569        a = 0.0;
18570        for (j = 0; j < 8; j++) {
18571            a += (double)s0[i].nfa[j] * fa[j];
18572        }
18573        w0 += s0[i].s * sin(a) + s0[i].c * cos(a);
18574        }
18575 
18576        for (i = NS1-1; i >= 0; i--) {
18577        a = 0.0;
18578        for (j = 0; j < 8; j++) {
18579            a += (double)s1[i].nfa[j] * fa[j];
18580        }
18581        w1 += s1[i].s * sin(a) + s1[i].c * cos(a);
18582        }
18583 
18584        for (i = NS2-1; i >= 0; i--) {
18585        a = 0.0;
18586        for (j = 0; j < 8; j++) {
18587            a += (double)s2[i].nfa[j] * fa[j];
18588        }
18589        w2 += s2[i].s * sin(a) + s2[i].c * cos(a);
18590        }
18591 
18592        for (i = NS3-1; i >= 0; i--) {
18593        a = 0.0;
18594        for (j = 0; j < 8; j++) {
18595            a += (double)s3[i].nfa[j] * fa[j];
18596        }
18597        w3 += s3[i].s * sin(a) + s3[i].c * cos(a);
18598        }
18599 
18600        for (i = NS4-1; i >= 0; i--) {
18601        a = 0.0;
18602        for (j = 0; j < 8; j++) {
18603            a += (double)s4[i].nfa[j] * fa[j];
18604        }
18605        w4 += s4[i].s * sin(a) + s4[i].c * cos(a);
18606        }
18607 
18608        s = (w0 +
18609            (w1 +
18610            (w2 +
18611            (w3 +
18612            (w4 +
18613             w5 * t) * t) * t) * t) * t) * DAS2R - x*y/2.0;
18614 
18615        return s;
18616 
18617         }
18618     
18619 
18620     /**
18621     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18622     *  the equator of the Celestial Intermediate Pole, using the IAU 2000A
18623     *  precession-nutation model.
18624     *
18625     *<p>This function is derived from the International Astronomical Union's
18626     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18627     *
18628     *<p>Status:  support function.
18629     *
18630     *<!-- Given: -->
18631     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18632     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18633     *
18634     * <!-- Returned (function value): -->
18635     *  @return double    the CIO locator s in radians (Note 2)
18636     *
18637     * <p>Notes:
18638     * <ol>
18639     *
18640     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18641     *     convenient way between the two arguments.  For example,
18642     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18643     *     among others:
18644     *<pre>
18645     *            date1          date2
18646     *
18647     *         2450123.7           0.0       (JD method)
18648     *         2451545.0       -1421.3       (J2000 method)
18649     *         2400000.5       50123.2       (MJD method)
18650     *         2450123.5           0.2       (date &amp; time method)
18651     *</pre>
18652     *     The JD method is the most natural and convenient to use in
18653     *     cases where the loss of several decimal digits of resolution
18654     *     is acceptable.  The J2000 method is best matched to the way
18655     *     the argument is handled internally and will deliver the
18656     *     optimum resolution.  The MJD method and the date &amp; time methods
18657     *     are both good compromises between resolution and convenience.
18658     *
18659     * <li> The CIO locator s is the difference between the right ascensions
18660     *     of the same point in two systems.  The two systems are the GCRS
18661     *     and the CIP,CIO, and the point is the ascending node of the
18662     *     CIP equator.  The CIO locator s remains a small fraction of
18663     *     1 arcsecond throughout 1900-2100.
18664     *
18665     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18666     *     are the x and y components of the CIP unit vector;  this series
18667     *     is more compact than a direct series for s would be.  The present
18668     *     function uses the full IAU 2000A nutation model when predicting
18669     *     the CIP position.  Faster results, with no significant loss of
18670     *     accuracy, can be obtained via the function jauS00b, which uses
18671     *     instead the IAU 2000B truncated model.
18672     *</ol>
18673     *<p>Called:<ul>
18674     *     <li>{@link #jauPnm00a} classical NPB matrix, IAU 2000A
18675     *     <li>{@link #jauBpn2xy} extract CIP X,Y from the BPN matrix
18676     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
18677     * </ul>
18678     *<p>References:
18679     *
18680     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
18681     *     "Expressions for the Celestial Intermediate Pole and Celestial
18682     *     Ephemeris Origin consistent with the IAU 2000A precession-
18683     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
18684     *
18685     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
18686     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
18687     *
18688     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
18689     *     IERS Technical Note No. 32, BKG (2004)
18690     *
18691     *@version 2010 January 18
18692     *
18693     *  @since Release 20101201
18694     *
18695     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18696     */
18697     public static double jauS00a(double date1, double date2)
18698     {
18699        double s;
18700 
18701 
18702     /* Bias-precession-nutation-matrix, IAU 2000A. */
18703        double rbpn[][] = jauPnm00a(date1, date2);
18704 
18705     /* Extract the CIP coordinates. */
18706        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
18707 
18708     /* Compute the CIO locator s, given the CIP coordinates. */
18709        s = jauS00(date1, date2, cip.x, cip.y);
18710 
18711        return s;
18712 
18713         }
18714     
18715 
18716     /**
18717     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18718     *  the equator of the Celestial Intermediate Pole, using the IAU 2000B
18719     *  precession-nutation model.
18720     *
18721     *<p>This function is derived from the International Astronomical Union's
18722     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18723     *
18724     *<p>Status:  support function.
18725     *
18726     *<!-- Given: -->
18727     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18728     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18729     *
18730     * <!-- Returned (function value): -->
18731     *  @return double    the CIO locator s in radians (Note 2)
18732     *
18733     * <p>Notes:
18734     * <ol>
18735     *
18736     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18737     *     convenient way between the two arguments.  For example,
18738     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18739     *     among others:
18740     *<pre>
18741     *            date1          date2
18742     *
18743     *         2450123.7           0.0       (JD method)
18744     *         2451545.0       -1421.3       (J2000 method)
18745     *         2400000.5       50123.2       (MJD method)
18746     *         2450123.5           0.2       (date &amp; time method)
18747     *</pre>
18748     *     The JD method is the most natural and convenient to use in
18749     *     cases where the loss of several decimal digits of resolution
18750     *     is acceptable.  The J2000 method is best matched to the way
18751     *     the argument is handled internally and will deliver the
18752     *     optimum resolution.  The MJD method and the date &amp; time methods
18753     *     are both good compromises between resolution and convenience.
18754     *
18755     * <li> The CIO locator s is the difference between the right ascensions
18756     *     of the same point in two systems.  The two systems are the GCRS
18757     *     and the CIP,CIO, and the point is the ascending node of the
18758     *     CIP equator.  The CIO locator s remains a small fraction of
18759     *     1 arcsecond throughout 1900-2100.
18760     *
18761     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18762     *     are the x and y components of the CIP unit vector;  this series
18763     *     is more compact than a direct series for s would be.  The present
18764     *     function uses the IAU 2000B truncated nutation model when
18765     *     predicting the CIP position.  The function jauS00a uses instead
18766     *     the full IAU 2000A model, but with no significant increase in
18767     *     accuracy and at some cost in speed.
18768     *</ol>
18769     *<p>Called:<ul>
18770     *     <li>{@link #jauPnm00b} classical NPB matrix, IAU 2000B
18771     *     <li>{@link #jauBpn2xy} extract CIP X,Y from the BPN matrix
18772     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
18773     * </ul>
18774     *<p>References:
18775     *
18776     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
18777     *     "Expressions for the Celestial Intermediate Pole and Celestial
18778     *     Ephemeris Origin consistent with the IAU 2000A precession-
18779     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
18780     *
18781     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
18782     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
18783     *
18784     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
18785     *     IERS Technical Note No. 32, BKG (2004)
18786     *
18787     *@version 2010 January 18
18788     *
18789     *  @since Release 20101201
18790     *
18791     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18792     */
18793     public static double jauS00b(double date1, double date2)
18794     {
18795        double rbpn[][] = new double[3][3], s;
18796 
18797 
18798     /* Bias-precession-nutation-matrix, IAU 2000B. */
18799        rbpn = jauPnm00b(date1, date2);
18800 
18801     /* Extract the CIP coordinates. */
18802        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
18803 
18804     /* Compute the CIO locator s, given the CIP coordinates. */
18805        s = jauS00(date1, date2, cip.x, cip.y);
18806 
18807        return s;
18808 
18809         }
18810     
18811 
18812     /**
18813     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18814     *  the equator of the Celestial Intermediate Pole, given the CIP's X,Y
18815     *  coordinates.  Compatible with IAU 2006/2000A precession-nutation.
18816     *
18817     *<p>This function is derived from the International Astronomical Union's
18818     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18819     *
18820     *<p>Status:  canonical model.
18821     *
18822     *<!-- Given: -->
18823     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18824     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18825     *     @param x double     CIP coordinates (Note 3)
18826     *     @param y double     CIP coordinates (Note 3) 
18827     *
18828     * <!-- Returned (function value): -->
18829     *  @return double    the CIO locator s in radians (Note 2)
18830     *
18831     * <p>Notes:
18832     * <ol>
18833     *
18834     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18835     *     convenient way between the two arguments.  For example,
18836     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18837     *     among others:
18838     *<pre>
18839     *            date1          date2
18840     *
18841     *         2450123.7           0.0       (JD method)
18842     *         2451545.0       -1421.3       (J2000 method)
18843     *         2400000.5       50123.2       (MJD method)
18844     *         2450123.5           0.2       (date &amp; time method)
18845     *</pre>
18846     *     The JD method is the most natural and convenient to use in
18847     *     cases where the loss of several decimal digits of resolution
18848     *     is acceptable.  The J2000 method is best matched to the way
18849     *     the argument is handled internally and will deliver the
18850     *     optimum resolution.  The MJD method and the date &amp; time methods
18851     *     are both good compromises between resolution and convenience.
18852     *
18853     * <li> The CIO locator s is the difference between the right ascensions
18854     *     of the same point in two systems:  the two systems are the GCRS
18855     *     and the CIP,CIO, and the point is the ascending node of the
18856     *     CIP equator.  The quantity s remains below 0.1 arcsecond
18857     *     throughout 1900-2100.
18858     *
18859     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18860     *     are the x and y components of the CIP unit vector;  this series
18861     *     is more compact than a direct series for s would be.  This
18862     *     function requires X,Y to be supplied by the caller, who is
18863     *     responsible for providing values that are consistent with the
18864     *     supplied date.
18865     *
18866     * <li> The model is consistent with the "P03" precession (Capitaine et
18867     *     al. 2003), adopted by IAU 2006 Resolution 1, 2006, and the
18868     *     IAU 2000A nutation (with P03 adjustments).
18869     *</ol>
18870     *<p>Called:<ul>
18871     *     <li>{@link #jauFal03} mean anomaly of the Moon
18872     *     <li>{@link #jauFalp03} mean anomaly of the Sun
18873     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
18874     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
18875     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
18876     *     <li>{@link #jauFave03} mean longitude of Venus
18877     *     <li>{@link #jauFae03} mean longitude of Earth
18878     *     <li>{@link #jauFapa03} general accumulated precession in longitude
18879     * </ul>
18880     *<p>References:
18881     *
18882     *    <p>Capitaine, N., Wallace, P.T. &amp; Chapront, J., 2003, Astron.
18883     *     Astrophys. 432, 355
18884     *
18885     *     <p>McCarthy, D.D., Petit, G. (eds.) 2004, IERS Conventions (2003),
18886     *     IERS Technical Note No. 32, BKG
18887     *
18888     *@version 2009 December 17
18889     *
18890     *  @since Release 20101201
18891     *
18892     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18893     */
18894     public static double jauS06(double date1, double date2, double x, double y)
18895     {
18896     /* Time since J2000.0, in Julian centuries */
18897        double t;
18898 
18899     /* Miscellaneous */
18900        int i, j;
18901        double a, w0, w1, w2, w3, w4, w5;
18902 
18903     /* Fundamental arguments */
18904        double fa[] = new double[8];
18905 
18906     /* Returned value */
18907        double s;
18908 
18909     /* --------------------- */
18910     /* The series for s+XY/2 */
18911     /* --------------------- */
18912 
18913     /* Polynomial coefficients */
18914        final double sp[] = {
18915 
18916        /* 1-6 */
18917               94.00e-6,
18918             3808.65e-6,
18919             -122.68e-6,
18920           -72574.11e-6,
18921               27.98e-6,
18922               15.62e-6
18923        };
18924 
18925     /* Terms of order t^0 */
18926        final TERM s0[] = {
18927 
18928        /* 1-10 */
18929           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0}, -2640.73e-6,   0.39e-6 ),
18930           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},   -63.53e-6,   0.02e-6 ),
18931           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},   -11.75e-6,  -0.01e-6 ),
18932           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},   -11.21e-6,  -0.01e-6 ),
18933           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},     4.57e-6,   0.00e-6 ),
18934           new TERM(new int[]{ 0,  0,  2,  0,  3,  0,  0,  0},    -2.02e-6,   0.00e-6 ),
18935           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},    -1.98e-6,   0.00e-6 ),
18936           new TERM(new int[]{ 0,  0,  0,  0,  3,  0,  0,  0},     1.72e-6,   0.00e-6 ),
18937           new TERM(new int[]{ 0,  1,  0,  0,  1,  0,  0,  0},     1.41e-6,   0.01e-6 ),
18938           new TERM(new int[]{ 0,  1,  0,  0, -1,  0,  0,  0},     1.26e-6,   0.01e-6 ),
18939 
18940        /* 11-20 */
18941           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18942           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18943           new TERM(new int[]{ 0,  1,  2, -2,  3,  0,  0,  0},    -0.46e-6,   0.00e-6 ),
18944           new TERM(new int[]{ 0,  1,  2, -2,  1,  0,  0,  0},    -0.45e-6,   0.00e-6 ),
18945           new TERM(new int[]{ 0,  0,  4, -4,  4,  0,  0,  0},    -0.36e-6,   0.00e-6 ),
18946           new TERM(new int[]{ 0,  0,  1, -1,  1, -8, 12,  0},     0.24e-6,   0.12e-6 ),
18947           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.32e-6,   0.00e-6 ),
18948           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.28e-6,   0.00e-6 ),
18949           new TERM(new int[]{ 1,  0,  2,  0,  3,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18950           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
18951 
18952        /* 21-30 */
18953           new TERM(new int[]{ 0,  0,  2, -2,  0,  0,  0,  0},     0.21e-6,   0.00e-6 ),
18954           new TERM(new int[]{ 0,  1, -2,  2, -3,  0,  0,  0},    -0.19e-6,   0.00e-6 ),
18955           new TERM(new int[]{ 0,  1, -2,  2, -1,  0,  0,  0},    -0.18e-6,   0.00e-6 ),
18956           new TERM(new int[]{ 0,  0,  0,  0,  0,  8,-13, -1},     0.10e-6,  -0.05e-6 ),
18957           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.15e-6,   0.00e-6 ),
18958           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18959           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18960           new TERM(new int[]{ 1,  0,  0, -2,  1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18961           new TERM(new int[]{ 1,  0,  0, -2, -1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18962           new TERM(new int[]{ 0,  0,  4, -2,  4,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
18963 
18964        /* 31-33 */
18965           new TERM(new int[]{ 0,  0,  2, -2,  4,  0,  0,  0},     0.11e-6,   0.00e-6 ),
18966           new TERM(new int[]{ 1,  0, -2,  0, -3,  0,  0,  0},    -0.11e-6,   0.00e-6 ),
18967           new TERM(new int[]{ 1,  0, -2,  0, -1,  0,  0,  0},    -0.11e-6,   0.00e-6 )
18968        };
18969 
18970     /* Terms of order t^1 */
18971        final TERM s1[] = {
18972 
18973        /* 1 - 3 */
18974           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -0.07e-6,   3.57e-6 ),
18975           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     1.73e-6,  -0.03e-6 ),
18976           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},     0.00e-6,   0.48e-6 )
18977        };
18978 
18979     /* Terms of order t^2 */
18980        final TERM s2[] = {
18981 
18982        /* 1-10 */
18983           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},   743.52e-6,  -0.17e-6 ),
18984           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    56.91e-6,   0.06e-6 ),
18985           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},     9.84e-6,  -0.01e-6 ),
18986           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -8.85e-6,   0.01e-6 ),
18987           new TERM(new int[]{ 0,  1,  0,  0,  0,  0,  0,  0},    -6.38e-6,  -0.05e-6 ),
18988           new TERM(new int[]{ 1,  0,  0,  0,  0,  0,  0,  0},    -3.07e-6,   0.00e-6 ),
18989           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     2.23e-6,   0.00e-6 ),
18990           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},     1.67e-6,   0.00e-6 ),
18991           new TERM(new int[]{ 1,  0,  2,  0,  2,  0,  0,  0},     1.30e-6,   0.00e-6 ),
18992           new TERM(new int[]{ 0,  1, -2,  2, -2,  0,  0,  0},     0.93e-6,   0.00e-6 ),
18993 
18994        /* 11-20 */
18995           new TERM(new int[]{ 1,  0,  0, -2,  0,  0,  0,  0},     0.68e-6,   0.00e-6 ),
18996           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},    -0.55e-6,   0.00e-6 ),
18997           new TERM(new int[]{ 1,  0, -2,  0, -2,  0,  0,  0},     0.53e-6,   0.00e-6 ),
18998           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18999           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
19000           new TERM(new int[]{ 1,  0, -2, -2, -2,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
19001           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},    -0.25e-6,   0.00e-6 ),
19002           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},     0.22e-6,   0.00e-6 ),
19003           new TERM(new int[]{ 2,  0,  0, -2,  0,  0,  0,  0},    -0.21e-6,   0.00e-6 ),
19004           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.20e-6,   0.00e-6 ),
19005 
19006        /* 21-25 */
19007           new TERM(new int[]{ 0,  0,  2,  2,  2,  0,  0,  0},     0.17e-6,   0.00e-6 ),
19008           new TERM(new int[]{ 2,  0,  2,  0,  2,  0,  0,  0},     0.13e-6,   0.00e-6 ),
19009           new TERM(new int[]{ 2,  0,  0,  0,  0,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
19010           new TERM(new int[]{ 1,  0,  2, -2,  2,  0,  0,  0},    -0.12e-6,   0.00e-6 ),
19011           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.11e-6,   0.00e-6 )
19012        };
19013 
19014     /* Terms of order t^3 */
19015        final TERM s3[] = {
19016 
19017        /* 1-4 */
19018           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     0.30e-6, -23.42e-6 ),
19019           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    -0.03e-6,  -1.46e-6 ),
19020           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.01e-6,  -0.25e-6 ),
19021           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},     0.00e-6,   0.23e-6 )
19022        };
19023 
19024     /* Terms of order t^4 */
19025        final TERM s4[] = {
19026 
19027        /* 1-1 */
19028           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},    -0.26e-6,  -0.01e-6 )
19029        };
19030 
19031     /* Number of terms in the series */
19032        final int NS0 = s0.length;
19033        final int NS1 = s1.length;
19034        final int NS2 = s2.length;
19035        final int NS3 = s3.length;
19036        final int NS4 = s4.length;
19037 
19038     /*--------------------------------------------------------------------*/
19039 
19040     /* Interval between fundamental epoch J2000.0 and current date (JC). */
19041        t = ((date1 - DJ00) + date2) / DJC;
19042 
19043     /* Fundamental Arguments (from IERS Conventions 2003) */
19044 
19045     /* Mean anomaly of the Moon. */
19046        fa[0] = jauFal03(t);
19047 
19048     /* Mean anomaly of the Sun. */
19049        fa[1] = jauFalp03(t);
19050 
19051     /* Mean longitude of the Moon minus that of the ascending node. */
19052        fa[2] = jauFaf03(t);
19053 
19054     /* Mean elongation of the Moon from the Sun. */
19055        fa[3] = jauFad03(t);
19056 
19057     /* Mean longitude of the ascending node of the Moon. */
19058        fa[4] = jauFaom03(t);
19059 
19060     /* Mean longitude of Venus. */
19061        fa[5] = jauFave03(t);
19062 
19063     /* Mean longitude of Earth. */
19064        fa[6] = jauFae03(t);
19065 
19066     /* General precession in longitude. */
19067        fa[7] = jauFapa03(t);
19068 
19069     /* Evaluate s. */
19070        w0 = sp[0];
19071        w1 = sp[1];
19072        w2 = sp[2];
19073        w3 = sp[3];
19074        w4 = sp[4];
19075        w5 = sp[5];
19076 
19077        for (i = NS0-1; i >= 0; i--) {
19078        a = 0.0;
19079        for (j = 0; j < 8; j++) {
19080           a += (double)s0[i].nfa[j] * fa[j];
19081        }
19082        w0 += s0[i].s * sin(a) + s0[i].c * cos(a);
19083        }
19084 
19085        for (i = NS1-1; i >= 0; i--) {
19086           a = 0.0;
19087           for (j = 0; j < 8; j++) {
19088              a += (double)s1[i].nfa[j] * fa[j];
19089           }
19090           w1 += s1[i].s * sin(a) + s1[i].c * cos(a);
19091        }
19092 
19093        for (i = NS2-1; i >= 0; i--) {
19094           a = 0.0;
19095           for (j = 0; j < 8; j++) {
19096              a += (double)s2[i].nfa[j] * fa[j];
19097           }
19098           w2 += s2[i].s * sin(a) + s2[i].c * cos(a);
19099        }
19100 
19101        for (i = NS3-1; i >= 0; i--) {
19102           a = 0.0;
19103           for (j = 0; j < 8; j++) {
19104              a += (double)s3[i].nfa[j] * fa[j];
19105           }
19106           w3 += s3[i].s * sin(a) + s3[i].c * cos(a);
19107        }
19108 
19109        for (i = NS4-1; i >= 0; i--) {
19110           a = 0.0;
19111           for (j = 0; j < 8; j++) {
19112              a += (double)s4[i].nfa[j] * fa[j];
19113           }
19114           w4 += s4[i].s * sin(a) + s4[i].c * cos(a);
19115        }
19116 
19117        s = (w0 +
19118            (w1 +
19119            (w2 +
19120            (w3 +
19121            (w4 +
19122             w5 * t) * t) * t) * t) * t) * DAS2R - x*y/2.0;
19123 
19124        return s;
19125 
19126         }
19127     
19128 
19129     /**
19130     *  The CIO locator s, positioning the Celestial Intermediate Origin on
19131     *  the equator of the Celestial Intermediate Pole, using the IAU 2006
19132     *  precession and IAU 2000A nutation models.
19133     *
19134     *<p>This function is derived from the International Astronomical Union's
19135     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19136     *
19137     *<p>Status:  support function.
19138     *
19139     *<!-- Given: -->
19140     *     @param date1 double TT as a 2-part Julian Date (Note 1)
19141     *     @param date2 double TT as a 2-part Julian Date (Note 1)
19142     *
19143     * <!-- Returned (function value): -->
19144     *  @return double    the CIO locator s in radians (Note 2)
19145     *
19146     * <p>Notes:
19147     * <ol>
19148     *
19149     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
19150     *     convenient way between the two arguments.  For example,
19151     *     JD(TT)=2450123.7 could be expressed in any of these ways,
19152     *     among others:
19153     *<pre>
19154     *            date1          date2
19155     *
19156     *         2450123.7           0.0       (JD method)
19157     *         2451545.0       -1421.3       (J2000 method)
19158     *         2400000.5       50123.2       (MJD method)
19159     *         2450123.5           0.2       (date &amp; time method)
19160     *</pre>
19161     *     The JD method is the most natural and convenient to use in
19162     *     cases where the loss of several decimal digits of resolution
19163     *     is acceptable.  The J2000 method is best matched to the way
19164     *     the argument is handled internally and will deliver the
19165     *     optimum resolution.  The MJD method and the date &amp; time methods
19166     *     are both good compromises between resolution and convenience.
19167     *
19168     * <li> The CIO locator s is the difference between the right ascensions
19169     *     of the same point in two systems.  The two systems are the GCRS
19170     *     and the CIP,CIO, and the point is the ascending node of the
19171     *     CIP equator.  The CIO locator s remains a small fraction of
19172     *     1 arcsecond throughout 1900-2100.
19173     *
19174     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
19175     *     are the x and y components of the CIP unit vector;  this series is
19176     *     more compact than a direct series for s would be.  The present
19177     *     function uses the full IAU 2000A nutation model when predicting
19178     *     the CIP position.
19179     *</ol>
19180     *<p>Called:<ul>
19181     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
19182     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
19183     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
19184     * </ul>
19185     *<p>References:
19186     *
19187     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
19188     *     "Expressions for the Celestial Intermediate Pole and Celestial
19189     *     Ephemeris Origin consistent with the IAU 2000A precession-
19190     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
19191     *
19192     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
19193     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
19194     *
19195     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
19196     *
19197     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
19198     *     IERS Technical Note No. 32, BKG
19199     *
19200     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
19201     *
19202     *@version 2010 January 18
19203     *
19204     *  @since Release 20101201
19205     *
19206     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19207     */
19208     public static double jauS06a(double date1, double date2)
19209     {
19210        double rnpb[][] = new double[3][3], s;
19211 
19212 
19213     /* Bias-precession-nutation-matrix, IAU 20006/2000A. */
19214        rnpb = jauPnm06a(date1, date2);
19215 
19216     /* Extract the CIP coordinates. */
19217        CelestialIntermediatePole cip = jauBpn2xy(rnpb);
19218 
19219     /* Compute the CIO locator s, given the CIP coordinates. */
19220        s = jauS06(date1, date2, cip.x, cip.y);
19221 
19222        return s;
19223 
19224         }
19225     
19226 
19227     /**
19228     *  Convert spherical coordinates to Cartesian.
19229     *
19230     *<p>This function is derived from the International Astronomical Union's
19231     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19232     *
19233     *<p>Status:  vector/matrix support function.
19234     *
19235     *<!-- Given: -->
19236     *     @param theta     double        longitude angle (radians)
19237     *     @param phi       double        latitude angle (radians)
19238     *
19239     *<!-- Returned: -->
19240     *     @return c         double[3]      <u>returned</u> direction cosines
19241     *
19242     *@version 2008 October 28
19243     *
19244     *  @since Release 20101201
19245     *
19246     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19247     */
19248     public static double[] jauS2c(double theta, double phi )
19249     {
19250        double cp, c[] = new double[3];
19251 
19252 
19253        cp = cos(phi);
19254        c[0] = cos(theta) * cp;
19255        c[1] = sin(theta) * cp;
19256        c[2] = sin(phi);
19257 
19258        return c;
19259 
19260         }
19261     
19262 
19263     /**
19264     *  Convert spherical polar coordinates to p-vector.
19265     *
19266     *<p>This function is derived from the International Astronomical Union's
19267     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19268     *
19269     *<p>Status:  vector/matrix support function.
19270     *
19271     *<!-- Given: -->
19272     *     @param theta    double        longitude angle (radians)
19273     *     @param phi      double        latitude angle (radians)
19274     *     @param r        double        radial distance
19275     *
19276     *<!-- Returned: -->
19277     *     @return p        double[3]      <u>returned</u> Cartesian coordinates
19278     *
19279     *<p>Called:<ul>
19280     *     <li>{@link #jauS2c} spherical coordinates to unit vector
19281     *     <li>{@link #jauSxp} multiply p-vector by scalar
19282     * </ul>
19283     *@version 2008 May 11
19284     *
19285     *  @since Release 20101201
19286     *
19287     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19288     */
19289     public static double[] jauS2p(double theta, double phi, double r )
19290     {
19291        double p[];
19292        double u[] = new double[3];
19293 
19294 
19295        u = jauS2c(theta,phi);
19296        p = jauSxp(r,u);
19297 
19298        return p;
19299 
19300         }
19301     
19302 
19303     /**
19304     *  Convert position/velocity from spherical to Cartesian coordinates.
19305     *
19306     *<p>This function is derived from the International Astronomical Union's
19307     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19308     *
19309     *<p>Status:  vector/matrix support function.
19310     *
19311     *<!-- Given: -->
19312     *     @param theta     double           longitude angle (radians)
19313     *     @param phi       double           latitude angle (radians)
19314     *     @param r         double           radial distance
19315     *     @param td        double           rate of change of theta
19316     *     @param pd        double           rate of change of phi
19317     *     @param rd        double           rate of change of r
19318     *
19319     *<!-- Returned: -->
19320     *     @return pv        double[2][3]      <u>returned</u> pv-vector
19321     *
19322     *@version 2008 May 25
19323     *
19324     *  @since Release 20101201
19325     *
19326     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19327     */
19328     public static double[][] jauS2pv(double theta, double phi, double r,
19329                  double td, double pd, double rd)
19330     {
19331        double pv[][] = new double[2][3];
19332        double st, ct, sp, cp, rcp, x, y, rpd, w;
19333 
19334 
19335        st = sin(theta);
19336        ct = cos(theta);
19337        sp = sin(phi);
19338        cp = cos(phi);
19339        rcp = r * cp;
19340        x = rcp * ct;
19341        y = rcp * st;
19342        rpd = r * pd;
19343        w = rpd*sp - cp*rd;
19344 
19345        pv[0][0] = x;
19346        pv[0][1] = y;
19347        pv[0][2] = r * sp;
19348        pv[1][0] = -y*td - w*ct;
19349        pv[1][1] =  x*td - w*st;
19350        pv[1][2] = rpd*cp + sp*rd;
19351 
19352        return pv;
19353 
19354         }
19355     
19356 
19357     /**
19358     *  Multiply a pv-vector by two scalars.
19359     *
19360     *<p>This function is derived from the International Astronomical Union's
19361     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19362     *
19363     *<p>Status:  vector/matrix support function.
19364     *
19365     *<!-- Given: -->
19366     *     @param s1      double          scalar to multiply position component by
19367     *     @param s2      double          scalar to multiply velocity component by
19368     *     @param pv      double[2][3]    pv-vector
19369     *
19370     *<!-- Returned: -->
19371     *     @return spv     double[2][3]     <u>returned</u> pv-vector: p scaled by s1, v scaled by s2
19372     *
19373     *  Note:
19374     *     It is permissible for pv and spv to be the same array.
19375     *
19376     *<p>Called:<ul>
19377     *     <li>{@link #jauSxp} multiply p-vector by scalar
19378     * </ul>
19379     *@version 2008 October 28
19380     *
19381     *  @since Release 20101201
19382     *
19383     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19384     */
19385     public static double[][] jauS2xpv(double s1, double s2, double pv[][])
19386     {
19387         double spv[][] = new double[2][3];
19388         spv[0] = jauSxp(s1, pv[0]);
19389         spv[1] =jauSxp(s2, pv[1]);
19390 
19391        return spv;
19392 
19393         }
19394     
19395 
19396     /**
19397     *  Angular separation between two p-vectors.
19398     *
19399     *<p>This function is derived from the International Astronomical Union's
19400     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19401     *
19402     *<p>Status:  vector/matrix support function.
19403     *
19404     *<!-- Given: -->
19405     *     @param a       double[3]     first p-vector (not necessarily unit length)
19406     *     @param b       double[3]     second p-vector (not necessarily unit length)
19407     *
19408     * <!-- Returned (function value): -->
19409     *  @return double       angular separation (radians, always positive)
19410     *
19411     * <p>Notes:
19412     * <ol>
19413     *
19414     * <li> If either vector is null, a zero result is returned.
19415     *
19416     * <li> The angular separation is most simply formulated in terms of
19417     *     scalar product.  However, this gives poor accuracy for angles
19418     *     near zero and pi.  The present algorithm uses both cross product
19419     *     and dot product, to deliver full accuracy whatever the size of
19420     *     the angle.
19421     *</ol>
19422     *<p>Called:<ul>
19423     *     <li>{@link #jauPxp} vector product of two p-vectors
19424     *     <li>{@link #jauPm} modulus of p-vector
19425     *     <li>{@link #jauPdp} scalar product of two p-vectors
19426     * </ul>
19427     *@version 2008 May 22
19428     *
19429     *  @since Release 20101201
19430     *
19431     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19432     */
19433     public static double jauSepp(double a[] , double b[] )
19434     {
19435        double axb[] = new double[3], ss, cs, s;
19436 
19437 
19438     /* Sine of angle between the vectors, multiplied by the two moduli. */
19439        axb = jauPxp(a,b);
19440        ss = jauPm(axb);
19441 
19442     /* Cosine of the angle, multiplied by the two moduli. */
19443        cs = jauPdp(a, b);
19444 
19445     /* The angle. */
19446        s = ((ss != 0.0) || (cs != 0.0)) ? atan2(ss, cs) : 0.0;
19447 
19448        return s;
19449 
19450         }
19451     
19452 
19453     /**
19454     *  Angular separation between two sets of spherical coordinates.
19455     *
19456     *<p>This function is derived from the International Astronomical Union's
19457     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19458     *
19459     *<p>Status:  vector/matrix support function.
19460     *
19461     *<!-- Given: -->
19462     *     @param al      double        first longitude (radians)
19463     *     @param ap      double        first latitude (radians)
19464     *     @param bl      double        second longitude (radians)
19465     *     @param bp      double        second latitude (radians)
19466     *
19467     * <!-- Returned (function value): -->
19468     *  @return double       angular separation (radians)
19469     *
19470     *<p>Called:<ul>
19471     *     <li>{@link #jauS2c} spherical coordinates to unit vector
19472     *     <li>{@link #jauSepp} angular separation between two p-vectors
19473     * </ul>
19474     *@version 2008 May 16
19475     *
19476     *  @since Release 20101201
19477     *
19478     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19479     */
19480     public static double jauSeps(double al, double ap, double bl, double bp)
19481     {
19482        double ac[] = new double[3], bc[] = new double[3], s;
19483 
19484 
19485     /* Spherical to Cartesian. */
19486        ac = jauS2c(al,ap);
19487        bc = jauS2c(bl,bp);
19488 
19489     /* Angle between the vectors. */
19490        s = jauSepp(ac, bc);
19491 
19492        return s;
19493 
19494         }
19495     
19496 
19497     /**
19498     *  The TIO locator s', positioning the Terrestrial Intermediate Origin
19499     *  on the equator of the Celestial Intermediate Pole.
19500     *
19501     *<p>This function is derived from the International Astronomical Union's
19502     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19503     *
19504     *<p>Status:  canonical model.
19505     *
19506     *<!-- Given: -->
19507     *     @param date1 double TT as a 2-part Julian Date (Note 1)
19508     *     @param date2 double TT as a 2-part Julian Date (Note 1)
19509     *
19510     * <!-- Returned (function value): -->
19511     *  @return double    the TIO locator s' in radians (Note 2)
19512     *
19513     * <p>Notes:
19514     * <ol>
19515     *
19516     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
19517     *     convenient way between the two arguments.  For example,
19518     *     JD(TT)=2450123.7 could be expressed in any of these ways,
19519     *     among others:
19520     *<pre>
19521     *            date1          date2
19522     *
19523     *         2450123.7           0.0       (JD method)
19524     *         2451545.0       -1421.3       (J2000 method)
19525     *         2400000.5       50123.2       (MJD method)
19526     *         2450123.5           0.2       (date &amp; time method)
19527     *</pre>
19528     *     The JD method is the most natural and convenient to use in
19529     *     cases where the loss of several decimal digits of resolution
19530     *     is acceptable.  The J2000 method is best matched to the way
19531     *     the argument is handled internally and will deliver the
19532     *     optimum resolution.  The MJD method and the date &amp; time methods
19533     *     are both good compromises between resolution and convenience.
19534     *
19535     * <li> The TIO locator s' is obtained from polar motion observations by
19536     *     numerical integration, and so is in essence unpredictable.
19537     *     However, it is dominated by a secular drift of about
19538     *     47 microarcseconds per century, which is the approximation
19539     *     evaluated by the present function.
19540     *</ol>
19541     *<p>Reference:
19542     *
19543     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
19544     *     IERS Technical Note No. 32, BKG (2004)
19545     *
19546     *@version 2008 May 24
19547     *
19548     *  @since Release 20101201
19549     *
19550     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19551     */
19552     public static double jauSp00(double date1, double date2)
19553     {
19554        double t, sp;
19555 
19556 
19557     /* Interval between fundamental epoch J2000.0 and current date (JC). */
19558        t = ((date1 - DJ00) + date2) / DJC;
19559 
19560     /* Approximate s'. */
19561        sp = -47e-6 * t * DAS2R;
19562 
19563        return sp;
19564 
19565         }
19566     
19567 
19568     /**
19569     *  Star proper motion:  update star catalog data for space motion.
19570     *
19571     *<p>This function is derived from the International Astronomical Union's
19572     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19573     *
19574     *<p>Status:  support function.
19575     *
19576     *<!-- Given: -->
19577     *     @param ra1     double      right ascension (radians), before
19578     *     @param dec1    double      declination (radians), before
19579     *     @param pmr1    double      RA proper motion (radians/year), before
19580     *     @param pmd1    double      Dec proper motion (radians/year), before
19581     *     @param px1     double      parallax (arcseconds), before
19582     *     @param rv1     double      radial velocity (km/s, +ve = receding), before
19583     *     @param ep1a    double      "before" epoch, part A (Note 1)
19584     *     @param ep1b    double      "before" epoch, part B (Note 1)
19585     *     @param ep2a    double      "after" epoch, part A (Note 1)
19586     *     @param ep2b    double      "after" epoch, part B (Note 1)
19587     *
19588     *<!-- Returned: -->
19589     *     @return ra2     double       <u>returned</u> right ascension (radians), after
19590     *             dec2    double       <u>returned</u> declination (radians), after
19591     *             pmr2    double       <u>returned</u> RA proper motion (radians/year), after
19592     *             pmd2    double       <u>returned</u> Dec proper motion (radians/year), after
19593     *             px2     double       <u>returned</u> parallax (arcseconds), after
19594     *             rv2     double       <u>returned</u> radial velocity (km/s, +ve = receding), after
19595     *
19596     * <!-- Returned (function value): -->
19597     *  @return int        status:
19598     *                          -1 = system error (should not occur)
19599     *                           0 = no warnings or errors
19600     *                           1 = distance overridden (Note 6)
19601     *                           2 = excessive velocity (Note 7)
19602     *                           4 = solution didn't converge (Note 8)
19603     *                        else = binary logical OR of the above warnings
19604     *FIXME need to return the status as well.
19605     * <p>Notes:
19606     * <ol>
19607     *
19608     * <li> The starting and ending TDB dates ep1a+ep1b and ep2a+ep2b are
19609     *     Julian Dates, apportioned in any convenient way between the two
19610     *     parts (A and B).  For example, JD(TDB)=2450123.7 could be
19611     *     expressed in any of these ways, among others:
19612     *<pre>
19613     *             epna          epnb
19614     *
19615     *         2450123.7           0.0       (JD method)
19616     *         2451545.0       -1421.3       (J2000 method)
19617     *         2400000.5       50123.2       (MJD method)
19618     *         2450123.5           0.2       (date &amp; time method)
19619     *</pre>
19620     *     The JD method is the most natural and convenient to use in
19621     *     cases where the loss of several decimal digits of resolution
19622     *     is acceptable.  The J2000 method is best matched to the way
19623     *     the argument is handled internally and will deliver the
19624     *     optimum resolution.  The MJD method and the date &amp; time methods
19625     *     are both good compromises between resolution and convenience.
19626     *
19627     * <li> In accordance with normal star-catalog conventions, the object's
19628     *     right ascension and declination are freed from the effects of
19629     *     secular aberration.  The frame, which is aligned to the catalog
19630     *     equator and equinox, is Lorentzian and centered on the SSB.
19631     *
19632     *     The proper motions are the rate of change of the right ascension
19633     *     and declination at the catalog epoch and are in radians per TDB
19634     *     Julian year.
19635     *
19636     *     The parallax and radial velocity are in the same frame.
19637     *
19638     * <li> Care is needed with units.  The star coordinates are in radians
19639     *     and the proper motions in radians per Julian year, but the
19640     *     parallax is in arcseconds.
19641     *
19642     * <li> The RA proper motion is in terms of coordinate angle, not true
19643     *     angle.  If the catalog uses arcseconds for both RA and Dec proper
19644     *     motions, the RA proper motion will need to be divided by cos(Dec)
19645     *     before use.
19646     *
19647     * <li> Straight-line motion at constant speed, in the inertial frame,
19648     *     is assumed.
19649     *
19650     * <li> An extremely small (or zero or negative) parallax is interpreted
19651     *     to mean that the object is on the "celestial sphere", the radius
19652     *     of which is an arbitrary (large) value (see the jauStarpv
19653     *     function for the value used).  When the distance is overridden in
19654     *     this way, the status, initially zero, has 1 added to it.
19655     *
19656     * <li> If the space velocity is a significant fraction of c (see the
19657     *     constant VMAX in the function jauStarpv),  it is arbitrarily set
19658     *     to zero.  When this action occurs, 2 is added to the status.
19659     *
19660     * <li> The relativistic adjustment carried out in the jauStarpv function
19661     *     involves an iterative calculation.  If the process fails to
19662     *     converge within a set number of iterations, 4 is added to the
19663     *     status.
19664     *</ol>
19665     *<p>Called:<ul>
19666     *     <li>{@link #jauStarpv} star catalog data to space motion pv-vector
19667     *     <li>{@link #jauPvu} update a pv-vector
19668     *     <li>{@link #jauPdp} scalar product of two p-vectors
19669     *     <li>{@link #jauPvstar} space motion pv-vector to star catalog data
19670     * </ul>
19671     *@version 2008 May 16
19672     *
19673     *  @since Release 20101201
19674     *
19675     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19676     */
19677     public static CatalogCoords jauStarpm(double ra1, double dec1,
19678                   double pmr1, double pmd1, double px1, double rv1,
19679                   double ep1a, double ep1b, double ep2a, double ep2b) throws JSOFAInternalError
19680     {
19681        double pv1[][] = new double[2][3], tl1, dt, pv[][] = new double[2][3], r2, rdv, v2, c2mv2, tl2,
19682               pv2[][] = new double[2][3];
19683        jauStarpv(ra1, dec1, pmr1, pmd1, px1, rv1, pv1);
19684 
19685     /* Light time when observed (days). */
19686        tl1 = jauPm(pv1[0]) / DC;
19687 
19688     /* Time interval, "before" to "after" (days). */
19689        dt = (ep2a - ep1a) + (ep2b - ep1b);
19690 
19691     /* Move star along track from the "before" observed position to the */
19692     /* "after" geometric position. */
19693        pv = jauPvu(dt + tl1, pv1);
19694 
19695     /* From this geometric position, deduce the observed light time (days) */
19696     /* at the "after" epoch (with theoretically unneccessary error check). */
19697        r2 = jauPdp(pv[0], pv[0]);
19698        rdv = jauPdp(pv[0], pv[1]);
19699        v2 = jauPdp(pv[1], pv[1]);
19700        c2mv2 = DC*DC - v2;
19701        if (c2mv2 <=  0) throw new JSOFAInternalError("internal error", -1);
19702        tl2 = (-rdv + sqrt(rdv*rdv + c2mv2*r2)) / c2mv2;
19703 
19704     /* Move the position along track from the observed place at the */
19705     /* "before" epoch to the observed place at the "after" epoch. */
19706        pv2 =jauPvu(dt + (tl1 - tl2), pv1 );
19707 
19708     /* Space motion pv-vector to RA,Dec etc. at the "after" epoch. */
19709        CatalogCoords cat = jauPvstar(pv2);
19710 
19711        return cat;
19712 
19713         }
19714     
19715 
19716     /**
19717     *  Convert star catalog coordinates to position+velocity vector.
19718     *
19719     *<p>This function is derived from the International Astronomical Union's
19720     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19721     *
19722     *<p>Status:  support function.
19723     *
19724     *  Given (Note 1):
19725     *   @param  ra     double        right ascension (radians)
19726     *   @param  dec    double        declination (radians)
19727     *   @param  pmr    double        RA proper motion (radians/year)
19728     *   @param  pmd    double        Dec proper motion (radians/year)
19729     *   @param  px     double        parallax (arcseconds)
19730     *   @param  rv     double        radial velocity (km/s, positive = receding)
19731     *
19732     *  Returned (Note 2):
19733     *   @param  pv     double[2][3]  pv-vector (au, au/day)
19734     *
19735     * <!-- Returned (function value): -->
19736     *  @return int           status:
19737     *                              0 = no warnings
19738     *                              1 = distance overridden (Note 6)
19739     *                              2 = excessive speed (Note 7)
19740     *                              4 = solution didn't converge (Note 8)
19741     *                           else = binary logical OR of the above
19742     *
19743     * <p>Notes:
19744     * <ol>
19745     *
19746     * <li> The star data accepted by this function are "observables" for an
19747     *     imaginary observer at the solar-system barycenter.  Proper motion
19748     *     and radial velocity are, strictly, in terms of barycentric
19749     *     coordinate time, TCB.  For most practical applications, it is
19750     *     permissible to neglect the distinction between TCB and ordinary
19751     *     "proper" time on Earth (TT/TAI).  The result will, as a rule, be
19752     *     limited by the intrinsic accuracy of the proper-motion and
19753     *     radial-velocity data;  moreover, the pv-vector is likely to be
19754     *     merely an intermediate result, so that a change of time unit
19755     *     would cancel out overall.
19756     *
19757     *     In accordance with normal star-catalog conventions, the object's
19758     *     right ascension and declination are freed from the effects of
19759     *     secular aberration.  The frame, which is aligned to the catalog
19760     *     equator and equinox, is Lorentzian and centered on the SSB.
19761     *
19762     * <li> The resulting position and velocity pv-vector is with respect to
19763     *     the same frame and, like the catalog coordinates, is freed from
19764     *     the effects of secular aberration.  Should the "coordinate
19765     *     direction", where the object was located at the catalog epoch, be
19766     *     required, it may be obtained by calculating the magnitude of the
19767     *     position vector pv[0][0-2] dividing by the speed of light in
19768     *     au/day to give the light-time, and then multiplying the space
19769     *     velocity pv[1][0-2] by this light-time and adding the result to
19770     *     pv[0][0-2].
19771     *
19772     *     Summarizing, the pv-vector returned is for most stars almost
19773     *     identical to the result of applying the standard geometrical
19774     *     "space motion" transformation.  The differences, which are the
19775     *     subject of the Stumpff paper referenced below, are:
19776     *
19777     *     (i) In stars with significant radial velocity and proper motion,
19778     *     the constantly changing light-time distorts the apparent proper
19779     *     motion.  Note that this is a classical, not a relativistic,
19780     *     effect.
19781     *
19782     *     (ii) The transformation complies with special relativity.
19783     *
19784     * <li> Care is needed with units.  The star coordinates are in radians
19785     *     and the proper motions in radians per Julian year, but the
19786     *     parallax is in arcseconds; the radial velocity is in km/s, but
19787     *     the pv-vector result is in au and au/day.
19788     *
19789     * <li> The RA proper motion is in terms of coordinate angle, not true
19790     *     angle.  If the catalog uses arcseconds for both RA and Dec proper
19791     *     motions, the RA proper motion will need to be divided by cos(Dec)
19792     *     before use.
19793     *
19794     * <li> Straight-line motion at constant speed, in the inertial frame,
19795     *     is assumed.
19796     *
19797     * <li> An extremely small (or zero or negative) parallax is interpreted
19798     *     to mean that the object is on the "celestial sphere", the radius
19799     *     of which is an arbitrary (large) value (see the constant PXMIN).
19800     *     When the distance is overridden in this way, the status,
19801     *     initially zero, has 1 added to it.
19802     *
19803     * <li> If the space velocity is a significant fraction of c (see the
19804     *     constant VMAX), it is arbitrarily set to zero.  When this action
19805     *     occurs, 2 is added to the status.
19806     *
19807     * <li> The relativistic adjustment involves an iterative calculation.
19808     *     If the process fails to converge within a set number (IMAX) of
19809     *     iterations, 4 is added to the status.
19810     *
19811     * <li> The inverse transformation is performed by the function
19812     *     jauPvstar.
19813     *</ol>
19814     *<p>Called:<ul>
19815     *     <li>{@link #jauS2pv} spherical coordinates to pv-vector
19816     *     <li>{@link #jauPm} modulus of p-vector
19817     *     <li>{@link #jauZp} zero p-vector
19818     *     <li>{@link #jauPn} decompose p-vector into modulus and direction
19819     *     <li>{@link #jauPdp} scalar product of two p-vectors
19820     *     <li>{@link #jauSxp} multiply p-vector by scalar
19821     *     <li>{@link #jauPmp} p-vector minus p-vector
19822     *     <li>{@link #jauPpp} p-vector plus p-vector
19823     * </ul>
19824     *<p>Reference:
19825     *
19826     *     Stumpff, P., 1985, Astron.Astrophys. 144, 232-240.
19827     *
19828     *@version 2023 May 4
19829     *
19830     *  @since Release 20101201
19831     *
19832     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19833     */
19834     public static int jauStarpv(double ra, double dec,
19835                   double pmr, double pmd, double px, double rv,
19836                   double pv[][])
19837     {
19838     /* Smallest allowed parallax */
19839        final double PXMIN = 1e-7;
19840 
19841     /* Largest allowed speed (fraction of c) */
19842        final double VMAX = 0.5;
19843 
19844     /* Maximum number of iterations for relativistic solution */
19845        final int IMAX = 100;
19846 
19847        int i, iwarn;
19848        double w, r, rd, rad, decd, v, x[] = new double[3], usr[] = new double[3], ust[] = new double[3],
19849               vsr, vst, betst, betsr, bett, betr,
19850               dd, ddel, ur[] = new double[3], ut[] = new double[3],
19851               d = 0.0, del = 0.0,       /* to prevent */
19852               odd = 0.0, oddel = 0.0,   /* compiler   */
19853               od = 0.0, odel = 0.0;     /* warnings   */
19854 
19855 
19856     /* Distance (au). */
19857        if (px >= PXMIN) {
19858           w = px;
19859           iwarn = 0;
19860        } else {
19861           w = PXMIN;
19862           iwarn = 1;
19863        }
19864        r = DR2AS / w;
19865 
19866     /* Radial speed (au/day). */
19867        rd = DAYSEC * rv * 1e3 / DAU;
19868 
19869     /* Proper motion (radian/day). */
19870        rad = pmr / DJY;
19871        decd = pmd / DJY;
19872 
19873     /* To pv-vector (au,au/day). */
19874        double[][] pvt = jauS2pv(ra, dec, r, rad, decd, rd);
19875        jauCpv(pvt,pv);
19876 
19877     /* If excessive velocity, arbitrarily set it to zero. */
19878        v = jauPm(pv[1]);
19879        if (v / DC > VMAX) {
19880           jauZp(pv[1]);
19881           iwarn += 2;
19882        }
19883 
19884     /* Isolate the radial component of the velocity (au/day). */
19885        NormalizedVector nv = jauPn(pv[0]);
19886        w = nv.r;
19887        x = nv.u;
19888        vsr = jauPdp(x, pv[1]);
19889        usr = jauSxp(vsr,x);
19890 
19891     /* Isolate the transverse component of the velocity (au/day). */
19892        ust = jauPmp(pv[1], usr);
19893        vst = jauPm(ust);
19894 
19895     /* Special-relativity dimensionless parameters. */
19896        betsr = vsr / DC;
19897        betst = vst / DC;
19898 
19899     /* Determine the inertial-to-observed relativistic correction terms. */
19900        bett = betst;
19901        betr = betsr;
19902        for (i = 0; i < IMAX; i++) {
19903           d = 1.0 + betr;
19904           w = betr*betr + bett*bett;
19905           del = - w / (sqrt(1.0 - w) + 1.0);
19906           betr = d * betsr + del;
19907           bett = d * betst;
19908           if (i > 0) {
19909              dd = abs(d - od);
19910              ddel = abs(del - odel);
19911              if ((i > 1) && (dd >= odd) && (ddel >= oddel)) break;
19912              odd = dd;
19913              oddel = ddel;
19914           }
19915           od = d;
19916           odel = del;
19917        }
19918        if (i >= IMAX) iwarn += 4;
19919 
19920     /* Scale observed tangential velocity vector into inertial (au/d). */
19921        ut = jauSxp(d,ust);
19922 
19923     /* Compute inertial radial velocity vector (au/d). */
19924        ur = jauSxp(DC*(d*betsr+del),x);
19925 
19926     /* Combine the two to obtain the inertial space velocity. */
19927        pv[1] = jauPpp(ur, ut);
19928        
19929     /* Return the status. */
19930        return iwarn;
19931 
19932         }
19933     
19934 
19935     /**
19936     *  Multiply a p-vector by a scalar.
19937     *
19938     *<p>This function is derived from the International Astronomical Union's
19939     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19940     *
19941     *<p>Status:  vector/matrix support function.
19942     *
19943     *<!-- Given: -->
19944     *     @param s       double         scalar
19945     *     @param p       double[3]      p-vector
19946     *
19947     *<!-- Returned: -->
19948     *     @return sp      double[3]       <u>returned</u> s * p
19949     *
19950     * 
19951     *
19952     *@version 2008 October 28
19953     *
19954     *  @since Release 20101201
19955     *
19956     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19957     */
19958     public static  double[] jauSxp(double s, double p[])
19959     {
19960        double sp[] = new double[3];
19961        sp[0] = s * p[0];
19962        sp[1] = s * p[1];
19963        sp[2] = s * p[2];
19964 
19965        return sp;
19966 
19967         }
19968     
19969 
19970     /**
19971     *  Multiply a pv-vector by a scalar.
19972     *
19973     *<p>This function is derived from the International Astronomical Union's
19974     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19975     *
19976     *<p>Status:  vector/matrix support function.
19977     *
19978     *<!-- Given: -->
19979     *     @param s        double           scalar
19980     *     @param pv       double[2][3]     pv-vector
19981     *
19982     *<!-- Returned: -->
19983     *     @return spv      double[2][3]      <u>returned</u> s * pv
19984     *
19985     *  Note:
19986     *     It is permissible for pv and psv to be the same array
19987     *
19988     *<p>Called:<ul>
19989     *     <li>{@link #jauS2xpv} multiply pv-vector by two scalars
19990     * </ul>
19991     *@version 2008 October 28
19992     *
19993     *  @since Release 20101201
19994     *
19995     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19996     */
19997     public static double[][] jauSxpv(double s, double pv[][])
19998     {
19999         double spv[][];
20000         spv = jauS2xpv(s, s, pv);
20001 
20002        return spv;
20003 
20004         }
20005 
20006     /**
20007      *
20008      *  Time scale transformation:  International Atomic Time, TAI, to
20009      *  Terrestrial Time, TT.
20010      *
20011      * <p>This function is derived from the International Astronomical Union's
20012      *  SOFA (Standards of Fundamental Astronomy) software collection.
20013      *
20014      *<p>Status:  canonical.
20015      *
20016      *<!-- Given: -->
20017      *  @param tai1 double    TAI as a 2-part Julian Date
20018      *  @param tai2 double    TAI as a 2-part Julian Date 
20019      *
20020      *<!-- Returned:-->
20021      *     @return JulianDate   TT as a 2-part Julian Date
20022      *
20023      *
20024      *  Note:
20025      *
20026      *     tai1+tai2 is Julian Date, apportioned in any convenient way
20027      *     between the two arguments, for example where tai1 is the Julian
20028      *     Day Number and tai2 is the fraction of a day.  The returned
20029      *     tt1,tt2 follow suit.
20030      *
20031      *<p>References:
20032      *
20033      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
20034      *     IERS Technical Note No. 32, BKG (2004)
20035      *
20036      *     Explanatory Supplement to the Astronomical Almanac,
20037      *     P. Kenneth Seidelmann (ed), University Science Books (1992)
20038      *
20039      *@version 2010 May 16
20040      *
20041      *@since SOFA release 2010-12-01
20042      *
20043      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20044      */
20045     public static JulianDate jauTaitt(double tai1, double tai2)
20046     {
20047 
20048         double tt1, tt2;
20049         /* TT minus TAI (days). */
20050         final double dtat = TTMTAI / DAYSEC;
20051 
20052         /* Result, safeguarding precision. */
20053         
20054         if ( abs(tai1) > abs(tai2) ) {
20055             tt1 = tai1;
20056             tt2 = tai2 + dtat;
20057         } else {
20058             tt1 = tai1 + dtat;
20059             tt2 = tai2;
20060         }
20061 
20062 
20063         return new JulianDate(tt1, tt2);
20064     };   
20065 
20066     /**
20067      *
20068      *  Time scale transformation:  International Atomic Time, TAI, to
20069      *  Universal Time, UT1.
20070      *
20071      * <p>This function is derived from the International Astronomical Union's
20072      *  SOFA (Standards of Fundamental Astronomy) software collection.
20073      *
20074      *<p>Status:  canonical.
20075      *
20076      *<!-- Given: -->
20077      *  @param tai1 double    TAI as a 2-part Julian Date
20078      *  @param tai2 double    TAI as a 2-part Julian Date 
20079      *  @param   dta        double    UT1-TAI in seconds
20080      *
20081      *<!-- Returned:-->
20082      *  @return      UT1 as a 2-part Julian Date
20083      *
20084      *
20085      *<p>Notes:
20086      *  <ol>
20087      * <li>  tai1+tai2 is Julian Date, apportioned in any convenient way
20088      *     between the two arguments, for example where tai1 is the Julian
20089      *     Day Number and tai2 is the fraction of a day.  The returned
20090      *     UT11,UT12 follow suit.
20091      *
20092      *  <li>  The argument dta, i.e. UT1-TAI, is an observed quantity, and is
20093      *     available from IERS tabulations.
20094      *  </ol>
20095      *  Reference:
20096      *
20097      *     Explanatory Supplement to the Astronomical Almanac,
20098      *     P. Kenneth Seidelmann (ed), University Science Books (1992)
20099      *
20100      *@version 2010 May 16
20101      *
20102      *@since SOFA release 2010-12-01
20103      *
20104      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20105      *
20106      */
20107     public static JulianDate jauTaiut1(double tai1, double tai2, double dta)
20108 
20109     {
20110         double dtad,ut11, ut12;
20111 
20112 
20113         /* Result, safeguarding precision. */
20114         dtad = dta / DAYSEC;
20115         if ( abs(tai1) > abs(tai2) ) {
20116             ut11 = tai1;
20117             ut12 = tai2 + dtad;
20118         } else {
20119             ut11 = tai1 + dtad;
20120             ut12 = tai2;
20121         }
20122 
20123         return new JulianDate(ut11, ut12);
20124     };   
20125 
20126     /**
20127      *
20128      *  Time scale transformation:  International Atomic Time, TAI, to
20129      *  Coordinated Universal Time, UTC.
20130      *
20131      * <p>This function is derived from the International Astronomical Union's
20132      *  SOFA (Standards of Fundamental Astronomy) software collection.
20133      *
20134      *<p>Status:  canonical.
20135      *
20136      *<!-- Given: -->
20137      *  @param tai1 TAI as a 2-part Julian Date (Note 1)
20138      *  @param tai2 TAI as a 2-part Julian Date (Note 1) 
20139      *
20140      *<!-- Returned:-->
20141      *  @return   UTC as a 2-part quasi Julian Date (Notes 1-3)
20142      *
20143      *  Returned (function value):
20144      *                int      status: +1 = dubious year (Note 4)
20145      *                                  0 = OK
20146      *                                 -1 = unacceptable date
20147      *
20148      *<p>Notes:</p>
20149      * <ol>
20150      * <li>  tai1+tai2 is Julian Date, apportioned in any convenient way
20151      *     between the two arguments, for example where tai1 is the Julian
20152      *     Day Number and tai2 is the fraction of a day.  The returned utc1
20153      *     and utc2 form an analogous pair, except that a special convention
20154      *     is used, to deal with the problem of leap seconds - see the next
20155      *     note.
20156      *
20157      *  <li> JD cannot unambiguously represent UTC during a leap second unless
20158      *     special measures are taken.  The convention in the present
20159      *     function is that the JD day represents UTC days whether the
20160      *     length is 86399, 86400 or 86401 SI seconds.
20161      *
20162      *  <li> The function jauD2dtf can be used to transform the UTC quasi-JD
20163      *     into calendar date and clock time, including UTC leap second
20164      *     handling.
20165      *
20166      *  <li> The warning status "dubious year" flags UTCs that predate the
20167      *     introduction of the time scale and that are too far in the future
20168      *     to be trusted.  See jauDat for further details.
20169      *  </ol>
20170      *  Called:
20171      *  <ul>
20172      *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
20173      *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
20174      *     <li>{@link #jauCal2jd}    Gregorian calendar to JD
20175      *</ul>
20176      *<p>References:
20177      *
20178      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
20179      *     IERS Technical Note No. 32, BKG (2004)
20180      *
20181      *     Explanatory Supplement to the Astronomical Almanac,
20182      *     P. Kenneth Seidelmann (ed), University Science Books (1992)
20183      *
20184      *@version 2010 May 16
20185      *
20186      *@since SOFA release 2010-12-01
20187      *
20188      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20189      * @throws JSOFAIllegalParameter 
20190      * @throws JSOFAInternalError an internal error has occured
20191      */
20192     public static JulianDate jauTaiutc(double tai1, double tai2) throws JSOFAIllegalParameter, JSOFAInternalError
20193     {
20194         boolean big1;
20195         int i;
20196         double a1, a2,dats1, ddats, dats2, datd = 0.0, as1, as2, da, d1, d2, fd;
20197         double utc1, utc2;
20198 
20199 
20200         /* Put the two parts of the TAI into big-first order. */
20201         big1 = ( abs(tai1) >= abs(tai2) );
20202         if ( big1 ) {
20203             a1 = tai1;
20204             a2 = tai2;
20205         } else {
20206             a1 = tai2;
20207             a2 = tai1;
20208         }
20209 
20210         /* See if the TAI can possibly be in a leap-second day. */
20211         d1 = a1;
20212         dats1 = 0.0;
20213         for ( i = -1; i <= 3; i++ ) {
20214             d2 = a2 + (double) i;
20215             Calendar dt;
20216             dt = jauJd2cal(d1, d2 );
20217             dats2 = jauDat(dt.iy, dt.im, dt.id, 0.0);
20218 //FIXME            if ( js < 0 ) return -1;
20219             if ( i == -1 ) dats1 = dats2;
20220             ddats = dats2 - dats1;
20221             datd = dats1 / DAYSEC;
20222             if ( abs(ddats) >= 0.5 ) {
20223 
20224                 /* Yes.  Get TAI for the start of the UTC day that */
20225                 /* ends in a leap. */
20226                 JulianDate jd = jauCal2jd(dt.iy, dt.im, dt.id );
20227                 d1 = jd.djm0; d2 = jd.djm1;
20228                 as1 = d1;
20229                 as2 = d2 - 1.0 + datd;
20230 
20231                 /* Is the TAI after this point? */
20232                 da = a1 - as1;
20233                 da = da + ( a2 - as2 );
20234                 if ( da > 0 ) {
20235 
20236                     /* Yes:  fraction of the current UTC day that has elapsed. */
20237                     fd = da * DAYSEC / ( DAYSEC + ddats );
20238 
20239                     /* Ramp TAI-UTC to bring about SOFA's JD(UTC) convention. */
20240                     datd += ddats * ( fd <= 1.0 ? fd : 1.0 ) / DAYSEC;
20241                 }
20242 
20243                 /* Done. */
20244                 break;
20245             }
20246             dats1 = dats2;
20247         }
20248 
20249         /* Subtract the (possibly adjusted) TAI-UTC from TAI to give UTC. */
20250         a2 -= datd;
20251 
20252         /* Return the UTC result, preserving the TAI order. */
20253         if ( big1 ) {
20254             utc1 = a1;
20255             utc2 = a2;
20256         } else {
20257             utc1 = a2;
20258             utc2 = a1;
20259         }
20260 
20261         /* TODO Status */
20262         return new JulianDate(utc1, utc2);
20263 
20264     };
20265 
20266     /**
20267      *
20268      *  Time scale transformation:  Barycentric Coordinate Time, TCB, to
20269      *  Barycentric Dynamical Time, TDB.
20270      *
20271      * <p>This function is derived from the International Astronomical Union's
20272      *  SOFA (Standards of Fundamental Astronomy) software collection.
20273      *
20274      *<p>Status:  canonical.
20275      *
20276      *<!-- Given: -->
20277      *   @param tcb1 double    TCB as a 2-part Julian Date
20278      *   @param tcb2 double    TCB as a 2-part Julian Date 
20279      *
20280      *<!-- Returned:-->
20281      *   @return    TDB as a 2-part Julian Date
20282      *
20283      *
20284      *<p>Notes:
20285      *  <ol>
20286      * <li>  tcb1+tcb2 is Julian Date, apportioned in any convenient way
20287      *     between the two arguments, for example where tcb1 is the Julian
20288      *     Day Number and tcb2 is the fraction of a day.  The returned
20289      *     tdb1,tdb2 follow suit.
20290      *
20291      * <li>  The 2006 IAU General Assembly introduced a conventional linear
20292      *     transformation between TDB and TCB.  This transformation
20293      *     compensates for the drift between TCB and terrestrial time TT,
20294      *     and keeps TDB approximately centered on TT.  Because the
20295      *     relationship between TT and TCB depends on the adopted solar
20296      *     system ephemeris, the degree of alignment between TDB and TT over
20297      *     long intervals will vary according to which ephemeris is used.
20298      *     Former definitions of TDB attempted to avoid this problem by
20299      *     stipulating that TDB and TT should differ only by periodic
20300      *     effects.  This is a good description of the nature of the
20301      *     relationship but eluded precise mathematical formulation.  The
20302      *     conventional linear relationship adopted in 2006 sidestepped
20303      *     these difficulties whilst delivering a TDB that in practice was
20304      *     consistent with values before that date.
20305      *
20306      *  <li>  TDB is essentially the same as Teph, the time argument for the
20307      *     JPL solar system ephemerides.
20308      * </ol>
20309      *  Reference:
20310      *
20311      *     IAU 2006 Resolution B3
20312      *
20313      *@version 2010 May 16
20314      *
20315      *@since SOFA release 2010-12-01
20316      *
20317      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20318      */
20319     public static JulianDate jauTcbtdb(double tcb1, double tcb2)
20320     {
20321         double tdb1, tdb2;
20322         /* 1977 Jan 1 00:00:32.184 TT, as two-part JD */
20323         final double t77td = DJM0 + DJM77;
20324         final double t77tf = TTMTAI/DAYSEC;
20325 
20326         /* TDB (days) at TAI 1977 Jan 1.0 */
20327         final double tdb0 = TDB0/86400.0;
20328 
20329         double d;
20330 
20331 
20332         /* Result, safeguarding precision. */
20333         if ( abs(tcb1) > abs(tcb2) ) {
20334             d = tcb1 - t77td;
20335             tdb1 = tcb1;
20336             tdb2 = tcb2 + tdb0 - ( d + ( tcb2 - t77tf ) ) * ELB;
20337         } else {
20338             d = tcb2 - t77td;
20339             tdb1 = tcb1 + tdb0 - ( d + ( tcb1 - t77tf ) ) * ELB;
20340             tdb2 = tcb2;
20341         }
20342 
20343 
20344         return new JulianDate(tdb1, tdb2);
20345 
20346     };
20347 
20348     /**
20349      *  Time scale transformation:  Geocentric Coordinate Time, TCG, to
20350      *  Terrestrial Time, TT.
20351      *
20352      * <p>This function is derived from the International Astronomical Union's
20353      *  SOFA (Standards of Fundamental Astronomy) software collection.
20354      *
20355      *<p>Status:  canonical.
20356      *
20357      *<!-- Given: -->
20358      *  @param tcg1 double    TCG as a 2-part Julian Date
20359      *  @param tcg2 double    TCG as a 2-part Julian Date 
20360      *
20361      *<!-- Returned:-->
20362      *   @return    TT as a 2-part Julian Date
20363      *
20364      *
20365      *  Note:
20366      *
20367      *     tcg1+tcg2 is Julian Date, apportioned in any convenient way
20368      *     between the two arguments, for example where tcg1 is the Julian
20369      *     Day Number and tcg22 is the fraction of a day.  The returned
20370      *     tt1,tt2 follow suit.
20371      *
20372      *<p>References:
20373      *
20374      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),.
20375      *     IERS Technical Note No. 32, BKG (2004)
20376      *
20377      *     IAU 2000 Resolution B1.9
20378      *
20379      *@version 2010 May 14
20380      *
20381      *@since SOFA release 2010-12-01
20382      *
20383      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20384      */
20385     public static JulianDate jauTcgtt(double tcg1, double tcg2)
20386     {
20387         double tt1,tt2;
20388         /* 1977 Jan 1 00:00:32.184 TT, as MJD */
20389         final double t77t = DJM77 + TTMTAI/DAYSEC;
20390 
20391 
20392         /* Result, safeguarding precision. */
20393         if ( abs(tcg1) > abs(tcg2) ) {
20394             tt1 = tcg1;
20395             tt2 = tcg2 - ( ( tcg1 - DJM0 ) + ( tcg2 - t77t ) ) * ELG;
20396         } else {
20397             tt1 = tcg1 - ( ( tcg2 - DJM0 ) + ( tcg1 - t77t ) ) * ELG;
20398             tt2 = tcg2;
20399         }
20400 
20401         return new JulianDate(tt1, tt2);
20402     };
20403 
20404 
20405     /**
20406      *
20407      *  Time scale transformation:  Barycentric Dynamical Time, TDB, to
20408      *  Barycentric Coordinate Time, TCB.
20409      *
20410      * <p>This function is derived from the International Astronomical Union's
20411      *  SOFA (Standards of Fundamental Astronomy) software collection.
20412      *
20413      *<p>Status:  canonical.
20414      *
20415      *<!-- Given: -->
20416      *   @param tdb1 TDB as a 2-part Julian Date
20417      *   @param tdb2 TDB as a 2-part Julian Date 
20418      *
20419      *<!-- Returned:-->
20420      *   @return    TCB as a 2-part Julian Date
20421      *
20422      *<p>Notes:
20423      * <ol>
20424      *  <li>  tdb1+tdb2 is Julian Date, apportioned in any convenient way
20425      *     between the two arguments, for example where tdb1 is the Julian
20426      *     Day Number and tdb2 is the fraction of a day.  The returned
20427      *     tcb1,tcb2 follow suit.
20428      *
20429      *  <li> The 2006 IAU General Assembly introduced a conventional linear
20430      *     transformation between TDB and TCB.  This transformation
20431      *     compensates for the drift between TCB and terrestrial time TT,
20432      *     and keeps TDB approximately centered on TT.  Because the
20433      *     relationship between TT and TCB depends on the adopted solar
20434      *     system ephemeris, the degree of alignment between TDB and TT over
20435      *     long intervals will vary according to which ephemeris is used.
20436      *     Former definitions of TDB attempted to avoid this problem by
20437      *     stipulating that TDB and TT should differ only by periodic
20438      *     effects.  This is a good description of the nature of the
20439      *     relationship but eluded precise mathematical formulation.  The
20440      *     conventional linear relationship adopted in 2006 sidestepped
20441      *     these difficulties whilst delivering a TDB that in practice was
20442      *     consistent with values before that date.
20443      *
20444      * <li>  TDB is essentially the same as Teph, the time argument for the
20445      *     JPL solar system ephemerides.
20446      *  </ol>
20447      *  Reference:
20448      *
20449      *     IAU 2006 Resolution B3
20450      *
20451      *@version 2010 September 10
20452      *
20453      *@since SOFA release 2010-12-01
20454      *
20455      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20456      */
20457     public static JulianDate jauTdbtcb(double tdb1, double tdb2 )
20458     {
20459         double tcb1, tcb2;
20460         /* 1977 Jan 1 00:00:32.184 TT, as two-part JD */
20461         final double t77td = DJM0 + DJM77;
20462         final double t77tf = TTMTAI/DAYSEC;
20463 
20464         /* TDB (days) at TAI 1977 Jan 1.0 */
20465         final double tdb0 = TDB0/DAYSEC;
20466 
20467         /* TDB to TCB rate */
20468         final double elbb = ELB/(1.0-ELB);
20469 
20470         double d, f;
20471 
20472 
20473         /* Result, preserving date format but safeguarding precision. */
20474         if ( abs(tdb1) > abs(tdb2) ) {
20475             d = t77td - tdb1;
20476             f  = tdb2 - tdb0;
20477             tcb1 = tdb1;
20478             tcb2 = f - ( d - ( f - t77tf ) ) * elbb;
20479         } else {
20480             d = t77td - tdb2;
20481             f  = tdb1 - tdb0;
20482             tcb1 = f - ( d - ( f - t77tf ) ) * elbb;
20483             tcb2 = tdb2;
20484         }
20485 
20486         return new JulianDate(tcb1, tcb2);
20487 
20488     };
20489 
20490 
20491     /**
20492      *
20493      *  Time scale transformation:  Barycentric Dynamical Time, TDB, to
20494      *  Terrestrial Time, TT.
20495      *
20496      * <p>This function is derived from the International Astronomical Union's
20497      *  SOFA (Standards of Fundamental Astronomy) software collection.
20498      *
20499      *<p>Status:  canonical.
20500      *
20501      *<!-- Given: -->
20502      *    @param tdb1 double    TDB as a 2-part Julian Date
20503      *    @param tdb2 double    TDB as a 2-part Julian Date 
20504      *    @param dtr        double    TDB-TT in seconds
20505      *
20506      *<!-- Returned:-->
20507      *   @return   TT as a 2-part Julian Date
20508      *
20509      *
20510      *<p>Notes:
20511      * <ol>
20512      * <li>  tdb1+tdb2 is Julian Date, apportioned in any convenient way
20513      *     between the two arguments, for example where tdb1 is the Julian
20514      *     Day Number and tdb2 is the fraction of a day.  The returned
20515      *     tt1,tt2 follow suit.
20516      *
20517      *  <li>  The argument dtr represents the quasi-periodic component of the
20518      *     GR transformation between TT and TCB.  It is dependent upon the
20519      *     adopted solar-system ephemeris, and can be obtained by numerical
20520      *     integration, by interrogating a precomputed time ephemeris or by
20521      *     evaluating a model such as that implemented in the SOFA function
20522      *     jauDtdb.   The quantity is dominated by an annual term of 1.7 ms
20523      *     amplitude.
20524      *
20525      *  <li>  TDB is essentially the same as Teph, the time argument for the
20526      *     JPL solar system ephemerides.
20527      *  </ol>
20528      *<p>References:
20529      *
20530      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
20531      *     IERS Technical Note No. 32, BKG (2004)
20532      *
20533      *     IAU 2006 Resolution 3
20534      *
20535      *@version 2010 May 13
20536      *
20537      *@since SOFA release 2010-12-01
20538      *
20539      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20540      *
20541      */
20542     public static JulianDate jauTdbtt(double tdb1, double tdb2, double dtr  )
20543     {
20544         double tt1, tt2;
20545         double dtrd;
20546 
20547 
20548         /* Result, safeguarding precision. */
20549         dtrd = dtr / DAYSEC;
20550         if ( abs(tdb1) > abs(tdb2) ) {
20551             tt1 = tdb1;
20552             tt2 = tdb2 - dtrd;
20553         } else {
20554             tt1 = tdb1 - dtrd;
20555             tt2 = tdb2;
20556         }
20557 
20558         return new JulianDate(tt1, tt2);
20559 
20560     }
20561 
20562     /**
20563      *
20564      *  Convert hours, minutes, seconds to radians.
20565      *
20566      * <p>This function is derived from the International Astronomical Union's
20567      *  SOFA (Standards of Fundamental Astronomy) software collection.
20568      *
20569      *<p>Status:  support function.
20570      *
20571      *<!-- Given: -->
20572      *     @param s         char     sign:  '-' = negative, otherwise positive
20573      *     @param ihour     int     hours
20574      *     @param imin      int     minutes
20575      *     @param sec       double  seconds
20576      *
20577      *<!-- Returned:-->
20578      *     @return      double  angle in radians
20579      *@throws JSOFAIllegalParameter illegal parameter of some form
20580      *                                1 = ihour outside range 0-23
20581      *                                2 = imin outside range 0-59
20582      *                                3 = sec outside range 0-59.999...
20583      *
20584      *<p>Notes:
20585      *<ul>
20586      *  <li>  The result is computed even if any of the range checks fail.
20587      *
20588      *  <li>  Negative ihour, imin and/or sec produce a warning status, but
20589      *      the absolute value is used in the conversion.
20590      *</ul>
20591      *@version 2010 August 27
20592      *
20593      *@since SOFA release 2010-12-01
20594      *
20595      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20596      * 
20597      */
20598     public static double jauTf2a(char s, int ihour, int imin, double sec ) throws JSOFAIllegalParameter
20599     {
20600         double rad;
20601 
20602         /* Compute the interval. */
20603         rad  = ( s == '-' ? -1.0 : 1.0 ) *
20604                 ( 60.0 * ( 60.0 * ( (double) abs(ihour) ) +
20605                         ( (double) abs(imin) ) ) +
20606                         abs(sec) ) * DS2R;
20607 
20608         /*  Validate arguments and return status. */
20609         if ( ihour < 0 || ihour > 23 ) throw new JSOFAIllegalParameter("bad hour", 1);   
20610         if ( imin < 0 || imin > 59 )   throw new JSOFAIllegalParameter("bad minute", 2); 
20611         if ( sec < 0.0 || sec >= 60.0 )throw new JSOFAIllegalParameter("bad second", 3); 
20612         return rad;
20613 
20614     };
20615 
20616     /**
20617      *
20618      *  Convert hours, minutes, seconds to days.
20619      *
20620      * <p>This function is derived from the International Astronomical Union's
20621      *  SOFA (Standards of Fundamental Astronomy) software collection.
20622      *
20623      *<p>Status:  support function.
20624      *
20625      *<!-- Given: -->
20626      *     @param s         char     sign:  '-' = negative, otherwise positive
20627      *     @param ihour     int     hours
20628      *     @param imin      int     minutes
20629      *     @param sec       double  seconds
20630      *
20631      *<!-- Returned:-->
20632      *     @return      double  interval in days
20633      *
20634      *  Returned (function value):
20635      *               int     status:  0 = OK
20636      *                                1 = ihour outside range 0-23
20637      *                                2 = imin outside range 0-59
20638      *                                3 = sec outside range 0-59.999...
20639      *
20640      *<p>Notes:
20641      *<ol>
20642      *  <li>  The result is computed even if any of the range checks fail.
20643      *
20644      *  <li>  Negative ihour, imin and/or sec produce a warning status, but
20645      *      the absolute value is used in the conversion.
20646      *</ol>
20647      *@version 2010 August 27
20648      *
20649      *@since SOFA release 2010-12-01
20650      *
20651      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20652      * @throws JSOFAIllegalParameter whne the inputs outside range - hour outside range 0-23, imin outside range 0-59, sec outside range 0-59.999... 
20653      */
20654     public static double jauTf2d(char s, int ihour, int imin, double sec) throws JSOFAIllegalParameter
20655     {
20656         double days;
20657         /* Compute the interval. */
20658         days  = ( s == '-' ? -1.0 : 1.0 ) *
20659                 ( 60.0 * ( 60.0 * ( (double) abs(ihour) ) +
20660                         ( (double) abs(imin) ) ) +
20661                         abs(sec) ) / DAYSEC;
20662 
20663         /*  Validate arguments and return status. */
20664         if ( ihour < 0 || ihour > 23 )  throw new JSOFAIllegalParameter("bad hour", 1);
20665         if ( imin < 0 || imin > 59 )    throw new JSOFAIllegalParameter("bad minute", 2);
20666         if ( sec < 0.0 || sec >= 60.0 ) throw new JSOFAIllegalParameter("bad second", 3);
20667         return days;
20668 
20669     }
20670 
20671     /**
20672      *  Transpose an r-matrix.
20673      *
20674      *<p>This function is derived from the International Astronomical Union's
20675      *  SOFA (Standards Of Fundamental Astronomy) software collection.
20676      *
20677      *<p>Status:  vector/matrix support function.
20678      *
20679      *<!-- Given: -->
20680      *     @param r         double[3][3]     r-matrix
20681      *
20682      *<!-- Returned: -->
20683      *     @return rt        double[3][3]      <u>returned</u> transpose
20684      *
20685      *  Note:
20686      *     It is permissible for r and rt to be the same array.
20687      *
20688      *<p>Called:<ul>
20689      *     <li>{@link #jauCr} copy r-matrix
20690      * </ul>
20691      *@version 2008 May 22
20692      *
20693      *  @since Release 20101201
20694      *
20695      *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
20696      */
20697     public static double[][] jauTr(double r[][])
20698     {
20699         double wm[][]= new double[3][3];
20700         int i, j;
20701 
20702 
20703         for (i = 0; i < 3; i++) {
20704             for (j = 0; j < 3; j++) {
20705                 wm[i][j] = r[j][i];
20706             }
20707         }
20708 
20709 
20710         return wm;
20711 
20712     }
20713 
20714 
20715     /**
20716      *  Multiply a p-vector by the transpose of an r-matrix.
20717      *
20718      *<p>This function is derived from the International Astronomical Union's
20719      *  SOFA (Standards Of Fundamental Astronomy) software collection.
20720      *
20721      *<p>Status:  vector/matrix support function.
20722      *
20723      *<!-- Given: -->
20724      *     @param r         double[3][3]    r-matrix
20725      *     @param p         double[3]       p-vector
20726      *
20727      *<!-- Returned: -->
20728      *     @return trp       double[3]        <u>returned</u> r * p
20729      *
20730      *  Note:
20731      *     It is permissible for p and trp to be the same array.
20732      *
20733      *<p>Called:<ul>
20734      *     <li>{@link #jauTr} transpose r-matrix
20735     *     <li>{@link #jauRxp} product of r-matrix and p-vector
20736     * </ul>
20737     *@version 2008 October 28
20738     *
20739     *  @since Release 20101201
20740     *
20741     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
20742     */
20743     public static double[] jauTrxp(double r[][], double p[]  )
20744     {
20745        double tr[][];
20746        double trp[];
20747 
20748     /* Transpose of matrix r. */
20749        tr = jauTr(r);
20750 
20751     /* Matrix tr * vector p -> vector trp. */
20752        trp = jauRxp(tr, p);
20753 
20754        return trp;
20755 
20756         }
20757     
20758 
20759     /**
20760     *  Multiply a pv-vector by the transpose of an r-matrix.
20761     *
20762     *<p>This function is derived from the International Astronomical Union's
20763     *  SOFA (Standards Of Fundamental Astronomy) software collection.
20764     *
20765     *<p>Status:  vector/matrix support function.
20766     *
20767     *<!-- Given: -->
20768     *     @param r         double[3][3]     r-matrix
20769     *     @param pv        double[2][3]     pv-vector
20770     *
20771     *<!-- Returned: -->
20772     *     @return trpv      double[2][3]      <u>returned</u> r * pv
20773     *
20774     *  Note:
20775     *     It is permissible for pv and trpv to be the same array.
20776     *
20777     *<p>Called:<ul>
20778     *     <li>{@link #jauTr} transpose r-matrix
20779     *     <li>{@link #jauRxpv} product of r-matrix and pv-vector
20780     * </ul>
20781     *@version 2008 October 28
20782     *
20783     *  @since Release 20101201
20784     *
20785     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
20786     */
20787     public static double[][] jauTrxpv(double r[][], double pv[][] )
20788     {
20789        double tr[][], trpv[][];
20790 
20791 
20792     /* Transpose of matrix r. */
20793        tr = jauTr(r);
20794 
20795     /* Matrix tr * vector pv -> vector trpv. */
20796        trpv = jauRxpv(tr, pv);
20797 
20798        return trpv;
20799 
20800         }
20801     
20802     /*
20803      * constant arrays set outside jauXy06 to avoid problems with 65535 byte limit on function size
20804      */
20805     static {
20806         /* need to define this function because it appears that javac lumps all of the statically defined initalizers into one function on 
20807          * compilation - so this will force a second function */
20808         init_mfals();
20809     }
20810     /** Fundamental-argument multipliers:  luni-solar terms */
20811     private static int mfals[][]; //IMPL would like to be final really
20812     
20813     private static void init_mfals(){
20814         
20815     mfals = new int[][]
20816     {
20817 
20818    /* 1-10 */
20819       {  0,   0,   0,   0,   1 },
20820       {  0,   0,   2,  -2,   2 },
20821       {  0,   0,   2,   0,   2 },
20822       {  0,   0,   0,   0,   2 },
20823       {  0,   1,   0,   0,   0 },
20824       {  0,   1,   2,  -2,   2 },
20825       {  1,   0,   0,   0,   0 },
20826       {  0,   0,   2,   0,   1 },
20827       {  1,   0,   2,   0,   2 },
20828       {  0,   1,  -2,   2,  -2 },
20829 
20830    /* 11-20 */
20831       {  0,   0,   2,  -2,   1 },
20832       {  1,   0,  -2,   0,  -2 },
20833       {  1,   0,   0,  -2,   0 },
20834       {  1,   0,   0,   0,   1 },
20835       {  1,   0,   0,   0,  -1 },
20836       {  1,   0,  -2,  -2,  -2 },
20837       {  1,   0,   2,   0,   1 },
20838       {  2,   0,  -2,   0,  -1 },
20839       {  0,   0,   0,   2,   0 },
20840       {  0,   0,   2,   2,   2 },
20841 
20842    /* 21-30 */
20843       {  2,   0,   0,  -2,   0 },
20844       {  0,   2,  -2,   2,  -2 },
20845       {  2,   0,   2,   0,   2 },
20846       {  1,   0,   2,  -2,   2 },
20847       {  1,   0,  -2,   0,  -1 },
20848       {  2,   0,   0,   0,   0 },
20849       {  0,   0,   2,   0,   0 },
20850       {  0,   1,   0,   0,   1 },
20851       {  1,   0,   0,  -2,  -1 },
20852       {  0,   2,   2,  -2,   2 },
20853 
20854    /* 31-40 */
20855       {  0,   0,   2,  -2,   0 },
20856       {  1,   0,   0,  -2,   1 },
20857       {  0,   1,   0,   0,  -1 },
20858       {  0,   2,   0,   0,   0 },
20859       {  1,   0,  -2,  -2,  -1 },
20860       {  1,   0,   2,   2,   2 },
20861       {  0,   1,   2,   0,   2 },
20862       {  2,   0,  -2,   0,   0 },
20863       {  0,   0,   2,   2,   1 },
20864       {  0,   1,  -2,   0,  -2 },
20865 
20866    /* 41-50 */
20867       {  0,   0,   0,   2,   1 },
20868       {  1,   0,   2,  -2,   1 },
20869       {  2,   0,   0,  -2,  -1 },
20870       {  2,   0,   2,  -2,   2 },
20871       {  2,   0,   2,   0,   1 },
20872       {  0,   0,   0,   2,  -1 },
20873       {  0,   1,  -2,   2,  -1 },
20874       {  1,   1,   0,  -2,   0 },
20875       {  2,   0,   0,  -2,   1 },
20876       {  1,   0,   0,   2,   0 },
20877 
20878    /* 51-60 */
20879       {  0,   1,   2,  -2,   1 },
20880       {  1,  -1,   0,   0,   0 },
20881       {  0,   1,  -1,   1,  -1 },
20882       {  2,   0,  -2,   0,  -2 },
20883       {  0,   1,   0,  -2,   0 },
20884       {  1,   0,   0,  -1,   0 },
20885       {  3,   0,   2,   0,   2 },
20886       {  0,   0,   0,   1,   0 },
20887       {  1,  -1,   2,   0,   2 },
20888       {  1,   1,  -2,  -2,  -2 },
20889 
20890    /* 61-70 */
20891       {  1,   0,  -2,   0,   0 },
20892       {  2,   0,   0,   0,  -1 },
20893       {  0,   1,  -2,  -2,  -2 },
20894       {  1,   1,   2,   0,   2 },
20895       {  2,   0,   0,   0,   1 },
20896       {  1,   1,   0,   0,   0 },
20897       {  1,   0,  -2,   2,  -1 },
20898       {  1,   0,   2,   0,   0 },
20899       {  1,  -1,   0,  -1,   0 },
20900       {  1,   0,   0,   0,   2 },
20901 
20902    /* 71-80 */
20903       {  1,   0,  -1,   0,  -1 },
20904       {  0,   0,   2,   1,   2 },
20905       {  1,   0,  -2,  -4,  -2 },
20906       {  1,  -1,   0,  -1,  -1 },
20907       {  1,   0,   2,   2,   1 },
20908       {  0,   2,  -2,   2,  -1 },
20909       {  1,   0,   0,   0,  -2 },
20910       {  2,   0,  -2,  -2,  -2 },
20911       {  1,   1,   2,  -2,   2 },
20912       {  2,   0,  -2,  -4,  -2 },
20913 
20914    /* 81-90 */
20915       {  1,   0,  -4,   0,  -2 },
20916       {  2,   0,   2,  -2,   1 },
20917       {  1,   0,   0,  -1,  -1 },
20918       {  2,   0,   2,   2,   2 },
20919       {  3,   0,   0,   0,   0 },
20920       {  1,   0,   0,   2,   1 },
20921       {  0,   0,   2,  -2,  -1 },
20922       {  3,   0,   2,  -2,   2 },
20923       {  0,   0,   4,  -2,   2 },
20924       {  1,   0,   0,  -4,   0 },
20925 
20926    /* 91-100 */
20927       {  0,   1,   2,   0,   1 },
20928       {  2,   0,   0,  -4,   0 },
20929       {  1,   1,   0,  -2,  -1 },
20930       {  2,   0,  -2,   0,   1 },
20931       {  0,   0,   2,   0,  -1 },
20932       {  0,   1,  -2,   0,  -1 },
20933       {  0,   1,   0,   0,   2 },
20934       {  0,   0,   2,  -1,   2 },
20935       {  0,   0,   2,   4,   2 },
20936       {  2,   1,   0,  -2,   0 },
20937 
20938    /* 101-110 */
20939       {  1,   1,   0,  -2,   1 },
20940       {  1,  -1,   0,  -2,   0 },
20941       {  1,  -1,   0,  -1,  -2 },
20942       {  1,  -1,   0,   0,   1 },
20943       {  0,   1,  -2,   2,   0 },
20944       {  0,   1,   0,   0,  -2 },
20945       {  1,  -1,   2,   2,   2 },
20946       {  1,   0,   0,   2,  -1 },
20947       {  1,  -1,  -2,  -2,  -2 },
20948       {  3,   0,   2,   0,   1 },
20949 
20950    /* 111-120 */
20951       {  0,   1,   2,   2,   2 },
20952       {  1,   0,   2,  -2,   0 },
20953       {  1,   1,  -2,  -2,  -1 },
20954       {  1,   0,   2,  -4,   1 },
20955       {  0,   1,  -2,  -2,  -1 },
20956       {  2,  -1,   2,   0,   2 },
20957       {  0,   0,   0,   2,   2 },
20958       {  1,  -1,   2,   0,   1 },
20959       {  1,  -1,  -2,   0,  -2 },
20960       {  0,   1,   0,   2,   0 },
20961 
20962    /* 121-130 */
20963       {  0,   1,   2,  -2,   0 },
20964       {  0,   0,   0,   1,   1 },
20965       {  1,   0,  -2,  -2,   0 },
20966       {  0,   3,   2,  -2,   2 },
20967       {  2,   1,   2,   0,   2 },
20968       {  1,   1,   0,   0,   1 },
20969       {  2,   0,   0,   2,   0 },
20970       {  1,   1,   2,   0,   1 },
20971       {  1,   0,   0,  -2,  -2 },
20972       {  1,   0,  -2,   2,   0 },
20973 
20974    /* 131-140 */
20975       {  1,   0,  -1,   0,  -2 },
20976       {  0,   1,   0,  -2,   1 },
20977       {  0,   1,   0,   1,   0 },
20978       {  0,   0,   0,   1,  -1 },
20979       {  1,   0,  -2,   2,  -2 },
20980       {  1,  -1,   0,   0,  -1 },
20981       {  0,   0,   0,   4,   0 },
20982       {  1,  -1,   0,   2,   0 },
20983       {  1,   0,   2,   1,   2 },
20984       {  1,   0,   2,  -1,   2 },
20985 
20986    /* 141-150 */
20987       {  0,   0,   2,   1,   1 },
20988       {  1,   0,   0,  -2,   2 },
20989       {  1,   0,  -2,   0,   1 },
20990       {  1,   0,  -2,  -4,  -1 },
20991       {  0,   0,   2,   2,   0 },
20992       {  1,   1,   2,  -2,   1 },
20993       {  1,   0,  -2,   1,  -1 },
20994       {  0,   0,   1,   0,   1 },
20995       {  2,   0,  -2,  -2,  -1 },
20996       {  4,   0,   2,   0,   2 },
20997 
20998    /* 151-160 */
20999       {  2,  -1,   0,   0,   0 },
21000       {  2,   1,   2,  -2,   2 },
21001       {  0,   1,   2,   1,   2 },
21002       {  1,   0,   4,  -2,   2 },
21003       {  1,   1,   0,   0,  -1 },
21004       {  2,   0,   2,   0,   0 },
21005       {  2,   0,  -2,  -4,  -1 },
21006       {  1,   0,  -1,   0,   0 },
21007       {  1,   0,   0,   1,   0 },
21008       {  0,   1,   0,   2,   1 },
21009 
21010    /* 161-170 */
21011       {  1,   0,  -4,   0,  -1 },
21012       {  1,   0,   0,  -4,  -1 },
21013       {  2,   0,   2,   2,   1 },
21014       {  2,   1,   0,   0,   0 },
21015       {  0,   0,   2,  -3,   2 },
21016       {  1,   2,   0,  -2,   0 },
21017       {  0,   3,   0,   0,   0 },
21018       {  0,   0,   4,   0,   2 },
21019       {  0,   0,   2,  -4,   1 },
21020       {  2,   0,   0,  -2,  -2 },
21021 
21022    /* 171-180 */
21023       {  1,   1,  -2,  -4,  -2 },
21024       {  0,   1,   0,  -2,  -1 },
21025       {  0,   0,   0,   4,   1 },
21026       {  3,   0,   2,  -2,   1 },
21027       {  1,   0,   2,   4,   2 },
21028       {  1,   1,  -2,   0,  -2 },
21029       {  0,   0,   4,  -2,   1 },
21030       {  2,  -2,   0,  -2,   0 },
21031       {  2,   1,   0,  -2,  -1 },
21032       {  0,   2,   0,  -2,   0 },
21033 
21034    /* 181-190 */
21035       {  1,   0,   0,  -1,   1 },
21036       {  1,   1,   2,   2,   2 },
21037       {  3,   0,   0,   0,  -1 },
21038       {  2,   0,   0,  -4,  -1 },
21039       {  3,   0,   2,   2,   2 },
21040       {  0,   0,   2,   4,   1 },
21041       {  0,   2,  -2,  -2,  -2 },
21042       {  1,  -1,   0,  -2,  -1 },
21043       {  0,   0,   2,  -1,   1 },
21044       {  2,   0,   0,   2,   1 },
21045 
21046    /* 191-200 */
21047       {  1,  -1,  -2,   2,  -1 },
21048       {  0,   0,   0,   2,  -2 },
21049       {  2,   0,   0,  -4,   1 },
21050       {  1,   0,   0,  -4,   1 },
21051       {  2,   0,   2,  -4,   1 },
21052       {  4,   0,   2,  -2,   2 },
21053       {  2,   1,  -2,   0,  -1 },
21054       {  2,   1,  -2,  -4,  -2 },
21055       {  3,   0,   0,  -4,   0 },
21056       {  1,  -1,   2,   2,   1 },
21057 
21058    /* 201-210 */
21059       {  1,  -1,  -2,   0,  -1 },
21060       {  0,   2,   0,   0,   1 },
21061       {  1,   2,  -2,  -2,  -2 },
21062       {  1,   1,   0,  -4,   0 },
21063       {  2,   0,   0,  -2,   2 },
21064       {  0,   2,   2,  -2,   1 },
21065       {  1,   0,   2,   0,  -1 },
21066       {  2,   1,   0,  -2,   1 },
21067       {  2,  -1,  -2,   0,  -1 },
21068       {  1,  -1,  -2,  -2,  -1 },
21069 
21070    /* 211-220 */
21071       {  0,   1,  -2,   1,  -2 },
21072       {  1,   0,  -4,   2,  -2 },
21073       {  0,   1,   2,   2,   1 },
21074       {  3,   0,   0,   0,   1 },
21075       {  2,  -1,   2,   2,   2 },
21076       {  0,   1,  -2,  -4,  -2 },
21077       {  1,   0,  -2,  -3,  -2 },
21078       {  2,   0,   0,   0,   2 },
21079       {  1,  -1,   0,  -2,  -2 },
21080       {  2,   0,  -2,   2,  -1 },
21081 
21082    /* 221-230 */
21083       {  0,   2,  -2,   0,  -2 },
21084       {  3,   0,  -2,   0,  -1 },
21085       {  2,  -1,   2,   0,   1 },
21086       {  1,   0,  -2,  -1,  -2 },
21087       {  0,   0,   2,   0,   3 },
21088       {  2,   0,  -4,   0,  -2 },
21089       {  2,   1,   0,  -4,   0 },
21090       {  1,   1,  -2,   1,  -1 },
21091       {  0,   2,   2,   0,   2 },
21092       {  1,  -1,   2,  -2,   2 },
21093 
21094    /* 231-240 */
21095       {  1,  -1,   0,  -2,   1 },
21096       {  2,   1,   2,   0,   1 },
21097       {  1,   0,   2,  -4,   2 },
21098       {  1,   1,  -2,   0,  -1 },
21099       {  1,   1,   0,   2,   0 },
21100       {  1,   0,   0,  -3,   0 },
21101       {  2,   0,   2,  -1,   2 },
21102       {  0,   2,   0,   0,  -1 },
21103       {  2,  -1,   0,  -2,   0 },
21104       {  4,   0,   0,   0,   0 },
21105 
21106    /* 241-250 */
21107       {  2,   1,  -2,  -2,  -2 },
21108       {  0,   2,  -2,   2,   0 },
21109       {  1,   0,   2,   1,   1 },
21110       {  1,   0,  -1,   0,  -3 },
21111       {  3,  -1,   2,   0,   2 },
21112       {  2,   0,   2,  -2,   0 },
21113       {  1,  -2,   0,   0,   0 },
21114       {  2,   0,   0,   0,  -2 },
21115       {  1,   0,   0,   4,   0 },
21116       {  0,   1,   0,   1,   1 },
21117 
21118    /* 251-260 */
21119       {  1,   0,   2,   2,   0 },
21120       {  0,   1,   0,   2,  -1 },
21121       {  0,   1,   0,   1,  -1 },
21122       {  0,   0,   2,  -2,   3 },
21123       {  3,   1,   2,   0,   2 },
21124       {  1,   1,   2,   1,   2 },
21125       {  1,   1,  -2,   2,  -1 },
21126       {  2,  -1,   2,  -2,   2 },
21127       {  1,  -2,   2,   0,   2 },
21128       {  1,   0,   2,  -4,   0 },
21129 
21130    /* 261-270 */
21131       {  0,   0,   1,   0,   0 },
21132       {  1,   0,   2,  -3,   1 },
21133       {  1,  -2,   0,  -2,   0 },
21134       {  2,   0,   0,   2,  -1 },
21135       {  1,   1,   2,  -4,   1 },
21136       {  4,   0,   2,   0,   1 },
21137       {  0,   1,   2,   1,   1 },
21138       {  1,   2,   2,  -2,   2 },
21139       {  2,   0,   2,   1,   2 },
21140       {  2,   1,   2,  -2,   1 },
21141 
21142    /* 271-280 */
21143       {  1,   0,   2,  -1,   1 },
21144       {  1,   0,   4,  -2,   1 },
21145       {  1,  -1,   2,  -2,   1 },
21146       {  0,   1,   0,  -4,   0 },
21147       {  3,   0,  -2,  -2,  -2 },
21148       {  0,   0,   4,  -4,   2 },
21149       {  2,   0,  -4,  -2,  -2 },
21150       {  2,  -2,   0,  -2,  -1 },
21151       {  1,   0,   2,  -2,  -1 },
21152       {  2,   0,  -2,  -6,  -2 },
21153 
21154    /* 281-290 */
21155       {  1,   0,  -2,   1,  -2 },
21156       {  1,   0,  -2,   2,   1 },
21157       {  1,  -1,   0,   2,  -1 },
21158       {  1,   0,  -2,   1,   0 },
21159       {  2,  -1,   0,  -2,   1 },
21160       {  1,  -1,   0,   2,   1 },
21161       {  2,   0,  -2,  -2,   0 },
21162       {  1,   0,   2,  -3,   2 },
21163       {  0,   0,   0,   4,  -1 },
21164       {  2,  -1,   0,   0,   1 },
21165 
21166    /* 291-300 */
21167       {  2,   0,   4,  -2,   2 },
21168       {  0,   0,   2,   3,   2 },
21169       {  0,   1,   4,  -2,   2 },
21170       {  0,   1,  -2,   2,   1 },
21171       {  1,   1,   0,   2,   1 },
21172       {  1,   0,   0,   4,   1 },
21173       {  0,   0,   4,   0,   1 },
21174       {  2,   0,   0,  -3,   0 },
21175       {  1,   0,   0,  -1,  -2 },
21176       {  1,  -2,  -2,  -2,  -2 },
21177 
21178    /* 301-310 */
21179       {  3,   0,   0,   2,   0 },
21180       {  2,   0,   2,  -4,   2 },
21181       {  1,   1,  -2,  -4,  -1 },
21182       {  1,   0,  -2,  -6,  -2 },
21183       {  2,  -1,   0,   0,  -1 },
21184       {  2,  -1,   0,   2,   0 },
21185       {  0,   1,   2,  -2,  -1 },
21186       {  1,   1,   0,   1,   0 },
21187       {  1,   2,   0,  -2,  -1 },
21188       {  1,   0,   0,   1,  -1 },
21189 
21190    /* 311-320 */
21191       {  0,   0,   1,   0,   2 },
21192       {  3,   1,   2,  -2,   2 },
21193       {  1,   0,  -4,  -2,  -2 },
21194       {  1,   0,   2,   4,   1 },
21195       {  1,  -2,   2,   2,   2 },
21196       {  1,  -1,  -2,  -4,  -2 },
21197       {  0,   0,   2,  -4,   2 },
21198       {  0,   0,   2,  -3,   1 },
21199       {  2,   1,  -2,   0,   0 },
21200       {  3,   0,  -2,  -2,  -1 },
21201 
21202    /* 321-330 */
21203       {  2,   0,   2,   4,   2 },
21204       {  0,   0,   0,   0,   3 },
21205       {  2,  -1,  -2,  -2,  -2 },
21206       {  2,   0,   0,  -1,   0 },
21207       {  3,   0,   2,  -4,   2 },
21208       {  2,   1,   2,   2,   2 },
21209       {  0,   0,   3,   0,   3 },
21210       {  1,   1,   2,   2,   1 },
21211       {  2,   1,   0,   0,  -1 },
21212       {  1,   2,   0,  -2,   1 },
21213 
21214    /* 331-340 */
21215       {  3,   0,   2,   2,   1 },
21216       {  1,  -1,  -2,   2,  -2 },
21217       {  1,   1,   0,  -1,   0 },
21218       {  1,   2,   0,   0,   0 },
21219       {  1,   0,   4,   0,   2 },
21220       {  1,  -1,   2,   4,   2 },
21221       {  2,   1,   0,   0,   1 },
21222       {  1,   0,   0,   2,   2 },
21223       {  1,  -1,  -2,   2,   0 },
21224       {  0,   2,  -2,  -2,  -1 },
21225 
21226    /* 341-350 */
21227       {  2,   0,  -2,   0,   2 },
21228       {  5,   0,   2,   0,   2 },
21229       {  3,   0,  -2,  -6,  -2 },
21230       {  1,  -1,   2,  -1,   2 },
21231       {  3,   0,   0,  -4,  -1 },
21232       {  1,   0,   0,   1,   1 },
21233       {  1,   0,  -4,   2,  -1 },
21234       {  0,   1,   2,  -4,   1 },
21235       {  1,   2,   2,   0,   2 },
21236       {  0,   1,   0,  -2,  -2 },
21237 
21238    /* 351-360 */
21239       {  0,   0,   2,  -1,   0 },
21240       {  1,   0,   1,   0,   1 },
21241       {  0,   2,   0,  -2,   1 },
21242       {  3,   0,   2,   0,   0 },
21243       {  1,   1,  -2,   1,   0 },
21244       {  2,   1,  -2,  -4,  -1 },
21245       {  3,  -1,   0,   0,   0 },
21246       {  2,  -1,  -2,   0,   0 },
21247       {  4,   0,   2,  -2,   1 },
21248       {  2,   0,  -2,   2,   0 },
21249 
21250    /* 361-370 */
21251       {  1,   1,   2,  -2,   0 },
21252       {  1,   0,  -2,   4,  -1 },
21253       {  1,   0,  -2,  -2,   1 },
21254       {  2,   0,   2,  -4,   0 },
21255       {  1,   1,   0,  -2,  -2 },
21256       {  1,   1,  -2,  -2,   0 },
21257       {  1,   0,   1,  -2,   1 },
21258       {  2,  -1,  -2,  -4,  -2 },
21259       {  3,   0,  -2,   0,  -2 },
21260       {  0,   1,  -2,  -2,   0 },
21261 
21262    /* 371-380 */
21263       {  3,   0,   0,  -2,  -1 },
21264       {  1,   0,  -2,  -3,  -1 },
21265       {  0,   1,   0,  -4,  -1 },
21266       {  1,  -2,   2,  -2,   1 },
21267       {  0,   1,  -2,   1,  -1 },
21268       {  1,  -1,   0,   0,   2 },
21269       {  2,   0,   0,   1,   0 },
21270       {  1,  -2,   0,   2,   0 },
21271       {  1,   2,  -2,  -2,  -1 },
21272       {  0,   0,   4,  -4,   1 },
21273 
21274    /* 381-390 */
21275       {  0,   1,   2,   4,   2 },
21276       {  0,   1,  -4,   2,  -2 },
21277       {  3,   0,  -2,   0,   0 },
21278       {  2,  -1,   2,   2,   1 },
21279       {  0,   1,  -2,  -4,  -1 },
21280       {  4,   0,   2,   2,   2 },
21281       {  2,   0,  -2,  -3,  -2 },
21282       {  2,   0,   0,  -6,   0 },
21283       {  1,   0,   2,   0,   3 },
21284       {  3,   1,   0,   0,   0 },
21285 
21286    /* 391-400 */
21287       {  3,   0,   0,  -4,   1 },
21288       {  1,  -1,   2,   0,   0 },
21289       {  1,  -1,   0,  -4,   0 },
21290       {  2,   0,  -2,   2,  -2 },
21291       {  1,   1,   0,  -2,   2 },
21292       {  4,   0,   0,  -2,   0 },
21293       {  2,   2,   0,  -2,   0 },
21294       {  0,   1,   2,   0,   0 },
21295       {  1,   1,   0,  -4,   1 },
21296       {  1,   0,   0,  -4,  -2 },
21297 
21298    /* 401-410 */
21299       {  0,   0,   0,   1,   2 },
21300       {  3,   0,   0,   2,   1 },
21301       {  1,   1,   0,  -4,  -1 },
21302       {  0,   0,   2,   2,  -1 },
21303       {  1,   1,   2,   0,   0 },
21304       {  1,  -1,   2,  -4,   1 },
21305       {  1,   1,   0,   0,   2 },
21306       {  0,   0,   2,   6,   2 },
21307       {  4,   0,  -2,  -2,  -1 },
21308       {  2,   1,   0,  -4,  -1 },
21309 
21310    /* 411-420 */
21311       {  0,   0,   0,   3,   1 },
21312       {  1,  -1,  -2,   0,   0 },
21313       {  0,   0,   2,   1,   0 },
21314       {  1,   0,   0,   2,  -2 },
21315       {  3,  -1,   2,   2,   2 },
21316       {  3,  -1,   2,  -2,   2 },
21317       {  1,   0,   0,  -1,   2 },
21318       {  1,  -2,   2,  -2,   2 },
21319       {  0,   1,   0,   2,   2 },
21320       {  0,   1,  -2,  -1,  -2 },
21321 
21322    /* 421-430 */
21323       {  1,   1,  -2,   0,   0 },
21324       {  0,   2,   2,  -2,   0 },
21325       {  3,  -1,  -2,  -1,  -2 },
21326       {  1,   0,   0,  -6,   0 },
21327       {  1,   0,  -2,  -4,   0 },
21328       {  2,   1,   0,  -4,   1 },
21329       {  2,   0,   2,   0,  -1 },
21330       {  2,   0,  -4,   0,  -1 },
21331       {  0,   0,   3,   0,   2 },
21332       {  2,   1,  -2,  -2,  -1 },
21333 
21334    /* 431-440 */
21335       {  1,  -2,   0,   0,   1 },
21336       {  2,  -1,   0,  -4,   0 },
21337       {  0,   0,   0,   3,   0 },
21338       {  5,   0,   2,  -2,   2 },
21339       {  1,   2,  -2,  -4,  -2 },
21340       {  1,   0,   4,  -4,   2 },
21341       {  0,   0,   4,  -1,   2 },
21342       {  3,   1,   0,  -4,   0 },
21343       {  3,   0,   0,  -6,   0 },
21344       {  2,   0,   0,   2,   2 },
21345 
21346    /* 441-450 */
21347       {  2,  -2,   2,   0,   2 },
21348       {  1,   0,   0,  -3,   1 },
21349       {  1,  -2,  -2,   0,  -2 },
21350       {  1,  -1,  -2,  -3,  -2 },
21351       {  0,   0,   2,  -2,  -2 },
21352       {  2,   0,  -2,  -4,   0 },
21353       {  1,   0,  -4,   0,   0 },
21354       {  0,   1,   0,  -1,   0 },
21355       {  4,   0,   0,   0,  -1 },
21356       {  3,   0,   2,  -1,   2 },
21357 
21358    /* 451-460 */
21359       {  3,  -1,   2,   0,   1 },
21360       {  2,   0,   2,  -1,   1 },
21361       {  1,   2,   2,  -2,   1 },
21362       {  1,   1,   0,   2,  -1 },
21363       {  0,   2,   2,   0,   1 },
21364       {  3,   1,   2,   0,   1 },
21365       {  1,   1,   2,   1,   1 },
21366       {  1,   1,   0,  -1,   1 },
21367       {  1,  -2,   0,  -2,  -1 },
21368       {  4,   0,   0,  -4,   0 },
21369 
21370    /* 461-470 */
21371       {  2,   1,   0,   2,   0 },
21372       {  1,  -1,   0,   4,   0 },
21373       {  0,   1,   0,  -2,   2 },
21374       {  0,   0,   2,   0,  -2 },
21375       {  1,   0,  -1,   0,   1 },
21376       {  3,   0,   2,  -2,   0 },
21377       {  2,   0,   2,   2,   0 },
21378       {  1,   2,   0,  -4,   0 },
21379       {  1,  -1,   0,  -3,   0 },
21380       {  0,   1,   0,   4,   0 },
21381 
21382    /* 471 - 480 */
21383       {  0,   1,  -2,   0,   0 },
21384       {  2,   2,   2,  -2,   2 },
21385       {  0,   0,   0,   1,  -2 },
21386       {  0,   2,  -2,   0,  -1 },
21387       {  4,   0,   2,  -4,   2 },
21388       {  2,   0,  -4,   2,  -2 },
21389       {  2,  -1,  -2,   0,  -2 },
21390       {  1,   1,   4,  -2,   2 },
21391       {  1,   1,   2,  -4,   2 },
21392       {  1,   0,   2,   3,   2 },
21393 
21394    /* 481-490 */
21395       {  1,   0,   0,   4,  -1 },
21396       {  0,   0,   0,   4,   2 },
21397       {  2,   0,   0,   4,   0 },
21398       {  1,   1,  -2,   2,   0 },
21399       {  2,   1,   2,   1,   2 },
21400       {  2,   1,   2,  -4,   1 },
21401       {  2,   0,   2,   1,   1 },
21402       {  2,   0,  -4,  -2,  -1 },
21403       {  2,   0,  -2,  -6,  -1 },
21404       {  2,  -1,   2,  -1,   2 },
21405 
21406    /* 491-500 */
21407       {  1,  -2,   2,   0,   1 },
21408       {  1,  -2,   0,  -2,   1 },
21409       {  1,  -1,   0,  -4,  -1 },
21410       {  0,   2,   2,   2,   2 },
21411       {  0,   2,  -2,  -4,  -2 },
21412       {  0,   1,   2,   3,   2 },
21413       {  0,   1,   0,  -4,   1 },
21414       {  3,   0,   0,  -2,   1 },
21415       {  2,   1,  -2,   0,   1 },
21416       {  2,   0,   4,  -2,   1 },
21417 
21418    /* 501-510 */
21419       {  2,   0,   0,  -3,  -1 },
21420       {  2,  -2,   0,  -2,   1 },
21421       {  2,  -1,   2,  -2,   1 },
21422       {  1,   0,   0,  -6,  -1 },
21423       {  1,  -2,   0,   0,  -1 },
21424       {  1,  -2,  -2,  -2,  -1 },
21425       {  0,   1,   4,  -2,   1 },
21426       {  0,   0,   2,   3,   1 },
21427       {  2,  -1,   0,  -1,   0 },
21428       {  1,   3,   0,  -2,   0 },
21429 
21430    /* 511-520 */
21431       {  0,   3,   0,  -2,   0 },
21432       {  2,  -2,   2,  -2,   2 },
21433       {  0,   0,   4,  -2,   0 },
21434       {  4,  -1,   2,   0,   2 },
21435       {  2,   2,  -2,  -4,  -2 },
21436       {  4,   1,   2,   0,   2 },
21437       {  4,  -1,  -2,  -2,  -2 },
21438       {  2,   1,   0,  -2,  -2 },
21439       {  2,   1,  -2,  -6,  -2 },
21440       {  2,   0,   0,  -1,   1 },
21441 
21442    /* 521-530 */
21443       {  2,  -1,  -2,   2,  -1 },
21444       {  1,   1,  -2,   2,  -2 },
21445       {  1,   1,  -2,  -3,  -2 },
21446       {  1,   0,   3,   0,   3 },
21447       {  1,   0,  -2,   1,   1 },
21448       {  1,   0,  -2,   0,   2 },
21449       {  1,  -1,   2,   1,   2 },
21450       {  1,  -1,   0,   0,  -2 },
21451       {  1,  -1,  -4,   2,  -2 },
21452       {  0,   3,  -2,  -2,  -2 },
21453 
21454    /* 531-540 */
21455       {  0,   1,   0,   4,   1 },
21456       {  0,   0,   4,   2,   2 },
21457       {  3,   0,  -2,  -2,   0 },
21458       {  2,  -2,   0,   0,   0 },
21459       {  1,   1,   2,  -4,   0 },
21460       {  1,   1,   0,  -3,   0 },
21461       {  1,   0,   2,  -3,   0 },
21462       {  1,  -1,   2,  -2,   0 },
21463       {  0,   2,   0,   2,   0 },
21464       {  0,   0,   2,   4,   0 },
21465 
21466    /* 541-550 */
21467       {  1,   0,   1,   0,   0 },
21468       {  3,   1,   2,  -2,   1 },
21469       {  3,   0,   4,  -2,   2 },
21470       {  3,   0,   2,   1,   2 },
21471       {  3,   0,   0,   2,  -1 },
21472       {  3,   0,   0,   0,   2 },
21473       {  3,   0,  -2,   2,  -1 },
21474       {  2,   0,   4,  -4,   2 },
21475       {  2,   0,   2,  -3,   2 },
21476       {  2,   0,   0,   4,   1 },
21477 
21478    /* 551-560 */
21479       {  2,   0,   0,  -3,   1 },
21480       {  2,   0,  -4,   2,  -1 },
21481       {  2,   0,  -2,  -2,   1 },
21482       {  2,  -2,   2,   2,   2 },
21483       {  2,  -2,   0,  -2,  -2 },
21484       {  2,  -1,   0,   2,   1 },
21485       {  2,  -1,   0,   2,  -1 },
21486       {  1,   1,   2,   4,   2 },
21487       {  1,   1,   0,   1,   1 },
21488       {  1,   1,   0,   1,  -1 },
21489 
21490    /* 561-570 */
21491       {  1,   1,  -2,  -6,  -2 },
21492       {  1,   0,   0,  -3,  -1 },
21493       {  1,   0,  -4,  -2,  -1 },
21494       {  1,   0,  -2,  -6,  -1 },
21495       {  1,  -2,   2,   2,   1 },
21496       {  1,  -2,  -2,   2,  -1 },
21497       {  1,  -1,  -2,  -4,  -1 },
21498       {  0,   2,   0,   0,   2 },
21499       {  0,   1,   2,  -4,   2 },
21500       {  0,   1,  -2,   4,  -1 },
21501 
21502    /* 571-580 */
21503       {  5,   0,   0,   0,   0 },
21504       {  3,   0,   0,  -3,   0 },
21505       {  2,   2,   0,  -4,   0 },
21506       {  1,  -1,   2,   2,   0 },
21507       {  0,   1,   0,   3,   0 },
21508       {  4,   0,  -2,   0,  -1 },
21509       {  3,   0,  -2,  -6,  -1 },
21510       {  3,   0,  -2,  -1,  -1 },
21511       {  2,   1,   2,   2,   1 },
21512       {  2,   1,   0,   2,   1 },
21513 
21514    /* 581-590 */
21515       {  2,   0,   2,   4,   1 },
21516       {  2,   0,   2,  -6,   1 },
21517       {  2,   0,   2,  -2,  -1 },
21518       {  2,   0,   0,  -6,  -1 },
21519       {  2,  -1,  -2,  -2,  -1 },
21520       {  1,   2,   2,   0,   1 },
21521       {  1,   2,   0,   0,   1 },
21522       {  1,   0,   4,   0,   1 },
21523       {  1,   0,   2,  -6,   1 },
21524       {  1,   0,   2,  -4,  -1 },
21525 
21526    /* 591-600 */
21527       {  1,   0,  -1,  -2,  -1 },
21528       {  1,  -1,   2,   4,   1 },
21529       {  1,  -1,   2,  -3,   1 },
21530       {  1,  -1,   0,   4,   1 },
21531       {  1,  -1,  -2,   1,  -1 },
21532       {  0,   1,   2,  -2,   3 },
21533       {  3,   0,   0,  -2,   0 },
21534       {  1,   0,   1,  -2,   0 },
21535       {  0,   2,   0,  -4,   0 },
21536       {  0,   0,   2,  -4,   0 },
21537 
21538    /* 601-610 */
21539       {  0,   0,   1,  -1,   0 },
21540       {  0,   0,   0,   6,   0 },
21541       {  0,   2,   0,   0,  -2 },
21542       {  0,   1,  -2,   2,  -3 },
21543       {  4,   0,   0,   2,   0 },
21544       {  3,   0,   0,  -1,   0 },
21545       {  3,  -1,   0,   2,   0 },
21546       {  2,   1,   0,   1,   0 },
21547       {  2,   1,   0,  -6,   0 },
21548       {  2,  -1,   2,   0,   0 },
21549 
21550    /* 611-620 */
21551       {  1,   0,   2,  -1,   0 },
21552       {  1,  -1,   0,   1,   0 },
21553       {  1,  -1,  -2,  -2,   0 },
21554       {  0,   1,   2,   2,   0 },
21555       {  0,   0,   2,  -3,   0 },
21556       {  2,   2,   0,  -2,  -1 },
21557       {  2,  -1,  -2,   0,   1 },
21558       {  1,   2,   2,  -4,   1 },
21559       {  0,   1,   4,  -4,   2 },
21560       {  0,   0,   0,   3,   2 },
21561 
21562    /* 621-630 */
21563       {  5,   0,   2,   0,   1 },
21564       {  4,   1,   2,  -2,   2 },
21565       {  4,   0,  -2,  -2,   0 },
21566       {  3,   1,   2,   2,   2 },
21567       {  3,   1,   0,  -2,   0 },
21568       {  3,   1,  -2,  -6,  -2 },
21569       {  3,   0,   0,   0,  -2 },
21570       {  3,   0,  -2,  -4,  -2 },
21571       {  3,  -1,   0,  -3,   0 },
21572       {  3,  -1,   0,  -2,   0 },
21573 
21574    /* 631-640 */
21575       {  2,   1,   2,   0,   0 },
21576       {  2,   1,   2,  -4,   2 },
21577       {  2,   1,   2,  -2,   0 },
21578       {  2,   1,   0,  -3,   0 },
21579       {  2,   1,  -2,   0,  -2 },
21580       {  2,   0,   0,  -4,   2 },
21581       {  2,   0,   0,  -4,  -2 },
21582       {  2,   0,  -2,  -5,  -2 },
21583       {  2,  -1,   2,   4,   2 },
21584       {  2,  -1,   0,  -2,   2 },
21585 
21586    /* 641-650 */
21587       {  1,   3,  -2,  -2,  -2 },
21588       {  1,   1,   0,   0,  -2 },
21589       {  1,   1,   0,  -6,   0 },
21590       {  1,   1,  -2,   1,  -2 },
21591       {  1,   1,  -2,  -1,  -2 },
21592       {  1,   0,   2,   1,   0 },
21593       {  1,   0,   0,   3,   0 },
21594       {  1,   0,   0,  -4,   2 },
21595       {  1,   0,  -2,   4,  -2 },
21596       {  1,  -2,   0,  -1,   0 },
21597 
21598    /* 651-NFLS */
21599       {  0,   1,  -4,   2,  -1 },
21600       {  1,   0,  -2,   0,  -3 },
21601       {  0,   0,   4,  -4,   4 }
21602    };
21603     }
21604 
21605 
21606     /* Fundamental-argument multipliers:  planetary terms */
21607       private static final int mfapl[][] = {
21608 
21609        /* 1-10 */
21610           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -2,  5,  0,  0,  0 },
21611           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0, -1 },
21612           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0, -2 },
21613           {  0,  0,  1, -1,  1,  0, -8, 12,  0,  0,  0,  0,  0,  0 },
21614           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  2 },
21615           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21616           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
21617           {  0,  0,  0,  0,  0,  0,  0,  8,-16,  4,  5,  0,  0,  0 },
21618           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
21619           {  0,  0,  0,  0,  1,  0,  0, -1,  2,  0,  0,  0,  0,  0 },
21620 
21621        /* 11-20 */
21622           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0, -1 },
21623           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  2, -5,  0,  0,  0 },
21624           {  0,  0,  2, -2,  1,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
21625           {  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0, -2 },
21626           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -1,  0,  0,  0,  2 },
21627           {  0,  0,  0,  0,  0,  0,  0,  2, -8,  3,  0,  0,  0, -2 },
21628           {  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0, -2 },
21629           {  0,  0,  0,  0,  0,  0,  0,  6, -8,  3,  0,  0,  0,  2 },
21630           {  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0 },
21631           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0,  0 },
21632 
21633        /* 21-30 */
21634           {  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
21635           {  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0,  2 },
21636           {  0,  0,  0,  0,  1,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
21637           {  0,  0,  0,  0,  1,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21638           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0 },
21639           {  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  0,  2 },
21640           {  0,  0,  1, -1,  1,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
21641           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21642           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  1 },
21643           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21644 
21645        /* 31-40 */
21646           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
21647           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0,  0 },
21648           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  0,  0,  2 },
21649           {  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0, -2 },
21650           {  0,  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0 },
21651           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  1 },
21652           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21653           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
21654           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0,  0 },
21655           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0, -1,  0,  0,  0 },
21656 
21657        /* 41-50 */
21658           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -2,  0,  0,  0,  0 },
21659           {  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0, -2 },
21660           {  0,  0,  1, -1,  0,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
21661           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -2,  0,  0,  0,  2 },
21662           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0, -2 },
21663           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0 },
21664           {  0,  0,  0,  0,  0,  0,  2, -1,  0,  0,  0,  0,  0,  2 },
21665           {  1,  0,  0,  0,  0,  0,-18, 16,  0,  0,  0,  0,  0,  0 },
21666           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21667           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  1,  0,  0,  0,  2 },
21668 
21669        /* 51-60 */
21670           {  0,  0,  1, -1,  1,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
21671           {  1,  0,  0,  0,  0,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
21672           {  0,  0,  2, -2,  0,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
21673           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -1,  0,  0,  0,  2 },
21674           {  1,  0,  2,  0,  2,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21675           {  0,  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  2 },
21676           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  1 },
21677           {  1,  0, -2,  0, -2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21678           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  2,  0,  0,  0 },
21679           {  0,  0,  2, -2,  1,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21680 
21681        /* 61-70 */
21682           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  2 },
21683           {  0,  0,  0,  0,  0,  0,  0,  8,-16,  4,  5,  0,  0, -2 },
21684           {  0,  0,  1, -1,  1,  0,  0,  3, -8,  3,  0,  0,  0,  0 },
21685           {  0,  0,  0,  0,  0,  0,  8,-11,  0,  0,  0,  0,  0, -2 },
21686           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  2 },
21687           {  0,  0,  0,  0,  0,  0,  0,  8,-16,  4,  5,  0,  0,  2 },
21688           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0, -1 },
21689           {  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0, -1 },
21690           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  0,  0,  0, -2 },
21691           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0 },
21692 
21693        /* 71-80 */
21694           {  0,  0,  0,  0,  0,  0,  6, -8,  0,  0,  0,  0,  0, -2 },
21695           {  0,  0,  0,  0,  0,  0,  3, -2,  0,  0,  0,  0,  0,  2 },
21696           {  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0,  0, -2 },
21697           {  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0,  0,  0, -2 },
21698           {  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0, -2 },
21699           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -2,  0,  0,  0,  2 },
21700           {  0,  0,  1, -1,  1,  0,  0, -5,  8, -3,  0,  0,  0,  0 },
21701           {  0,  0,  0,  0,  0,  0,  0,  1,  2,  0,  0,  0,  0,  2 },
21702           {  0,  0,  0,  0,  0,  0,  0,  3, -2,  0,  0,  0,  0,  2 },
21703           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0,  0 },
21704 
21705        /* 81-90 */
21706           {  2,  0,  0, -2,  1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21707           {  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0, -1 },
21708           {  2,  0,  0, -2,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21709           {  0,  0,  0,  0,  1,  0,  8,-13,  0,  0,  0,  0,  0,  0 },
21710           {  0,  0,  0,  0,  1,  0,  0,  0,  0, -2,  5,  0,  0,  0 },
21711           {  1,  0,  0, -1,  0,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21712           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  2 },
21713           {  1,  0,  0,  0, -1,  0,-18, 16,  0,  0,  0,  0,  0,  0 },
21714           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  2, -5,  0,  0,  0 },
21715           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  1,  0,  0,  0,  0 },
21716 
21717        /* 91-100 */
21718           {  1,  0,  0, -2,  0,  0, 19,-21,  3,  0,  0,  0,  0,  0 },
21719           {  0,  0,  0,  0,  1,  0, -8, 13,  0,  0,  0,  0,  0,  0 },
21720           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  1,  0,  0,  0 },
21721           {  0,  0,  0,  0,  0,  0,  7, -9,  0,  0,  0,  0,  0, -2 },
21722           {  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  2 },
21723           {  1,  0,  0,  0,  1,  0,-18, 16,  0,  0,  0,  0,  0,  0 },
21724           {  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0, -1 },
21725           {  0,  0,  0,  0,  0,  0,  0,  6,-16,  4,  5,  0,  0, -2 },
21726           {  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0,  0, -2 },
21727           {  0,  0,  0,  0,  0,  0,  3, -7,  0,  0,  0,  0,  0, -2 },
21728 
21729        /* 101-110 */
21730           {  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0, -1 },
21731           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  1 },
21732           {  2,  0,  0, -2,  1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21733           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0, -1 },
21734           {  0,  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0 },
21735           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0,  0 },
21736           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21737           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0,  0 },
21738           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0 },
21739           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  2,  0,  0,  0,  2 },
21740 
21741        /* 111-120 */
21742           {  0,  0,  0,  0,  1,  0,  0,  1, -2,  0,  0,  0,  0,  0 },
21743           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  2 },
21744           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21745           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -3,  0,  0,  0,  0 },
21746           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0, -1 },
21747           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0,  2 },
21748           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0,  0 },
21749           {  0,  0,  1, -1,  0,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
21750           {  2,  0,  0, -2,  0,  0, -6,  8,  0,  0,  0,  0,  0,  0 },
21751           {  0,  0,  1, -1,  1,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
21752 
21753        /* 121-130 */
21754           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  1 },
21755           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21756           {  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0, -1 },
21757           {  0,  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0 },
21758           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0, -2 },
21759           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -1,  0,  0,  0 },
21760           {  0,  0,  0,  0,  0,  0,  8,-10,  0,  0,  0,  0,  0, -2 },
21761           {  0,  0,  1, -1,  1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21762           {  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0, -2 },
21763           {  1,  0,  0, -1,  1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21764 
21765        /* 131-140 */
21766           {  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0, -1 },
21767           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0,  0 },
21768           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -1 },
21769           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0, -1 },
21770           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0 },
21771           {  0,  0,  0,  0,  0,  0,  0,  0,  4,  0,  0,  0,  0,  2 },
21772           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -3,  0,  0,  0,  2 },
21773           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0,  1 },
21774           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  1 },
21775           {  0,  0,  0,  0,  1,  0,  2, -3,  0,  0,  0,  0,  0,  0 },
21776 
21777        /* 141-150 */
21778           {  1,  0,  0, -1,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21779           {  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0, -1 },
21780           {  0,  0,  0,  0,  0,  0,  0,  5, -4,  0,  0,  0,  0,  2 },
21781           {  0,  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  2 },
21782           {  0,  0,  0,  0,  0,  0,  9,-11,  0,  0,  0,  0,  0, -2 },
21783           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0, -1 },
21784           {  0,  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0,  0 },
21785           {  0,  0,  1, -1,  1,  0, -4,  5,  0,  0,  0,  0,  0,  0 },
21786           {  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0,  0 },
21787           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -1,  0,  0,  0,  2 },
21788 
21789        /* 151-160 */
21790           {  1,  0,  0, -1,  1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21791           {  0,  0,  1,  1,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21792           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -4, 10,  0,  0,  0 },
21793           {  0,  0,  0,  0,  1,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
21794           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0, -1,  0,  0,  0 },
21795           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  0,  0,  0,  0 },
21796           {  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  0,  2 },
21797           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0, -2 },
21798           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0, -2 },
21799           {  0,  0,  2, -2,  1,  0, -4,  4,  0,  0,  0,  0,  0,  0 },
21800 
21801        /* 161-170 */
21802           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  0, -1,  0,  0,  2 },
21803           {  0,  0,  0,  0,  0,  0,  0,  4, -3,  0,  0,  0,  0,  2 },
21804           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0,  0,  2,  0 },
21805           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0, -1 },
21806           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0, -1 },
21807           {  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0,  0 },
21808           {  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  1 },
21809           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  1,  0,  0,  0 },
21810           {  0,  0,  2, -2,  1,  0,  0, -9, 13,  0,  0,  0,  0,  0 },
21811           {  2,  0,  2,  0,  2,  0,  0,  2,  0, -3,  0,  0,  0,  0 },
21812 
21813        /* 171-180 */
21814           {  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0, -2 },
21815           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  0,  2,  0,  0,  0 },
21816           {  1,  0,  0, -1, -1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21817           {  0,  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0, -2 },
21818           {  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  0,  0 },
21819           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  1 },
21820           {  1,  0,  2,  0,  1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21821           {  1,  0, -2,  0, -1,  0,  0, -1,  0,  0,  0,  0,  0,  0 },
21822           {  0,  0,  0,  0,  1,  0,  0, -2,  4,  0,  0,  0,  0,  0 },
21823           {  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0 },
21824 
21825        /* 181-190 */
21826           {  0,  0,  0,  0,  0,  0,  2,  1,  0,  0,  0,  0,  0,  2 },
21827           {  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  0,  1 },
21828           {  0,  0,  2,  0,  2,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21829           {  0,  0,  0,  0,  0,  0,  0,  1, -8,  3,  0,  0,  0, -2 },
21830           {  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0,  0, -2 },
21831           {  0,  0,  0,  0,  0,  0,  0,  7, -8,  3,  0,  0,  0,  2 },
21832           {  0,  0,  0,  0,  1,  0, -3,  5,  0,  0,  0,  0,  0,  0 },
21833           {  0,  0,  1, -1,  1,  0, -1,  0,  0,  0,  0,  0,  0,  0 },
21834           {  0,  0,  1, -1,  0,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
21835           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  0,  0,  0,  1 },
21836 
21837        /* 191-200 */
21838           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -1,  0,  0,  0,  0 },
21839           {  0,  0,  0,  0,  0,  0,  7,-10,  0,  0,  0,  0,  0, -2 },
21840           {  1,  0,  0, -2,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21841           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0 },
21842           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  2, -5,  0,  0,  0 },
21843           {  0,  0,  0,  0,  0,  0,  6, -8,  0,  0,  0,  0,  0, -1 },
21844           {  0,  0,  1, -1,  1,  0,  0, -9, 15,  0,  0,  0,  0,  0 },
21845           {  0,  0,  0,  0,  1,  0, -2,  3,  0,  0,  0,  0,  0,  0 },
21846           {  0,  0,  0,  0,  1,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
21847           {  0,  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0 },
21848 
21849        /* 201-210 */
21850           {  0,  0,  0,  0,  0,  0,  0,  1, -4,  0,  0,  0,  0, -2 },
21851           {  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  0,  2 },
21852           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -1,  0,  0,  2 },
21853           {  2,  0,  0, -2,  1,  0, -6,  8,  0,  0,  0,  0,  0,  0 },
21854           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0, -1 },
21855           {  0,  0,  1, -1,  1,  0,  3, -6,  0,  0,  0,  0,  0,  0 },
21856           {  0,  0,  1, -1,  1,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
21857           {  0,  0,  1, -1,  1,  0,  8,-14,  0,  0,  0,  0,  0,  0 },
21858           {  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0,  0 },
21859           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21860 
21861        /* 211-220 */
21862           {  0,  0,  0,  0,  1,  0,  0,  8,-15,  0,  0,  0,  0,  0 },
21863           {  0,  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0 },
21864           {  0,  0,  0,  0,  0,  0,  7, -7,  0,  0,  0,  0,  0,  0 },
21865           {  2,  0,  0, -2,  1,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21866           {  0,  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  2 },
21867           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  1,  0,  0,  2 },
21868           {  2,  0, -1, -1,  0,  0,  0,  3, -7,  0,  0,  0,  0,  0 },
21869           {  0,  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0, -2 },
21870           {  0,  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0 },
21871           {  0,  0,  1, -1,  1,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
21872 
21873        /* 221-230 */
21874           {  2,  0,  0, -2,  0,  0,  0, -6,  8,  0,  0,  0,  0,  0 },
21875           {  2,  0,  0, -2,  0,  0,  0, -5,  6,  0,  0,  0,  0,  0 },
21876           {  0,  0,  0,  0,  1,  0,  0,  0,  0, -1,  0,  0,  0,  0 },
21877           {  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0,  1 },
21878           {  0,  0,  0,  0,  0,  0,  2,  1,  0,  0,  0,  0,  0,  1 },
21879           {  0,  0,  0,  0,  0,  0,  1,  2,  0,  0,  0,  0,  0,  2 },
21880           {  0,  0,  0,  0,  1,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
21881           {  0,  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0 },
21882           {  0,  0,  0,  0,  0,  0,  3, -9,  4,  0,  0,  0,  0, -2 },
21883           {  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0, -2 },
21884 
21885        /* 231-240 */
21886           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -4,  0,  0,  0, -2 },
21887           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  1 },
21888           {  0,  0,  0,  0,  0,  0,  7,-11,  0,  0,  0,  0,  0, -2 },
21889           {  0,  0,  0,  0,  0,  0,  3, -5,  4,  0,  0,  0,  0,  2 },
21890           {  0,  0,  1, -1,  0,  0,  0, -1,  0, -1,  1,  0,  0,  0 },
21891           {  2,  0,  0,  0,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21892           {  0,  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0, -2 },
21893           {  0,  0,  1, -1,  2,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
21894           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  2 },
21895           {  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  0, -1 },
21896 
21897        /* 241-250 */
21898           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -1,  1,  0,  0,  0 },
21899           {  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0,  1 },
21900           {  0,  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0,  0 },
21901           {  0,  0,  0,  0,  0,  0,  0,  3, -8,  3,  0,  0,  0,  0 },
21902           {  0,  0,  1, -1,  1,  0,  2, -4,  0, -3,  0,  0,  0,  0 },
21903           {  0,  0,  0,  0,  1,  0,  3, -5,  0,  2,  0,  0,  0,  0 },
21904           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -3,  0,  0,  0,  2 },
21905           {  0,  0,  2, -2,  2,  0, -8, 11,  0,  0,  0,  0,  0,  0 },
21906           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  3,  0,  0,  0,  0 },
21907           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -2,  0,  0,  0 },
21908 
21909        /* 251-260 */
21910           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  1,  0,  0,  2 },
21911           {  0,  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0, -2 },
21912           {  0,  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  2 },
21913           {  0,  0,  0,  0,  0,  0,  7, -9,  0,  0,  0,  0,  0, -1 },
21914           {  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0,  0, -1 },
21915           {  0,  0,  0,  0,  0,  0,  2, -1,  0,  0,  0,  0,  0,  0 },
21916           {  1,  0, -2, -2, -2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21917           {  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  2 },
21918           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  5,  0,  0,  2 },
21919           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0,  1 },
21920 
21921        /* 261-270 */
21922           {  0,  0,  0,  0,  0,  0,  0,  6,  0,  0,  0,  0,  0,  2 },
21923           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  2, -5,  0,  0,  2 },
21924           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  0,  5,  0,  0,  0 },
21925           {  2,  0,  0, -2, -1,  0, -6,  8,  0,  0,  0,  0,  0,  0 },
21926           {  1,  0,  0, -2,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21927           {  0,  0,  0,  0,  0,  0,  8, -8,  0,  0,  0,  0,  0,  0 },
21928           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  2, -5,  0,  0,  2 },
21929           {  0,  0,  0,  0,  1,  0,  3, -7,  4,  0,  0,  0,  0,  0 },
21930           {  0,  0,  2, -2,  1,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
21931           {  0,  0,  0,  0,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21932 
21933        /* 271-280 */
21934           {  0,  0,  1, -1,  0,  0,  0, -1,  0, -2,  5,  0,  0,  0 },
21935           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -3,  0,  0,  0,  0 },
21936           {  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  0,  1 },
21937           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0, -2 },
21938           {  0,  0,  0,  0,  0,  0,  0, 11,  0,  0,  0,  0,  0,  2 },
21939           {  0,  0,  0,  0,  0,  0,  0,  6,-15,  0,  0,  0,  0, -2 },
21940           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  1,  0,  0,  0,  2 },
21941           {  1,  0,  0, -1,  0,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
21942           {  0,  0,  0,  0,  1,  0, -3,  7, -4,  0,  0,  0,  0,  0 },
21943           {  0,  0,  0,  0,  0,  0,  0,  5,  0, -2,  0,  0,  0,  2 },
21944 
21945        /* 281-290 */
21946           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0,  1 },
21947           {  0,  0,  2, -2,  2,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
21948           {  0,  0,  2, -2,  2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21949           {  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  0,  0,  0,  2 },
21950           {  0,  0,  0,  0,  0,  0,  0,  6,  0,  0,  0,  0,  0,  0 },
21951           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0,  2 },
21952           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  0,  0,  0,  0, -2 },
21953           {  0,  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0 },
21954           {  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0,  0 },
21955           {  0,  0,  0,  0,  0,  0,  0,  6,-11,  0,  0,  0,  0, -2 },
21956 
21957        /* 291-300 */
21958           {  0,  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0, -2 },
21959           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  3,  0,  0,  0,  0 },
21960           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21961           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0,  1 },
21962           {  0,  0,  0,  0,  0,  0,  9,-12,  0,  0,  0,  0,  0, -2 },
21963           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0,  1 },
21964           {  0,  0,  1, -1,  0,  0, -8, 12,  0,  0,  0,  0,  0,  0 },
21965           {  0,  0,  1, -1,  1,  0, -2,  3,  0,  0,  0,  0,  0,  0 },
21966           {  0,  0,  0,  0,  0,  0,  7, -7,  0,  0,  0,  0,  0, -1 },
21967           {  0,  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0, -1 },
21968 
21969        /* 301-310 */
21970           {  0,  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  2 },
21971           {  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0,  0,  0, -2 },
21972           {  0,  0,  1, -1,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21973           {  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0, -1 },
21974           {  0,  0,  1, -1, -1,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
21975           {  0,  0,  0,  0,  0,  0,  0,  1, -5,  0,  0,  0,  0, -2 },
21976           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  3, -1,  0,  0,  0 },
21977           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -2,  0,  0,  0 },
21978           {  0,  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0,  0 },
21979           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0,  2 },
21980 
21981        /* 311-320 */
21982           {  0,  0,  0,  0,  0,  0,  9, -9,  0,  0,  0,  0,  0, -1 },
21983           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  3,  0,  0,  0 },
21984           {  0,  0,  0,  0,  1,  0,  0,  2, -4,  0,  0,  0,  0,  0 },
21985           {  0,  0,  0,  0,  0,  0,  5, -3,  0,  0,  0,  0,  0,  2 },
21986           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  1 },
21987           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21988           {  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0,  0, -2 },
21989           {  0,  0,  0,  0,  0,  0,  0,  5, -3,  0,  0,  0,  0,  2 },
21990           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  4,  0,  0,  0,  2 },
21991           {  0,  0,  2,  0,  2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21992 
21993        /* 321-330 */
21994           {  0,  0,  2,  0,  2,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
21995           {  0,  0,  0,  0,  0,  0,  0,  5,  0, -3,  0,  0,  0,  2 },
21996           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  0,  0,  0 },
21997           {  2,  0, -1, -1, -1,  0,  0, -1,  0,  3,  0,  0,  0,  0 },
21998           {  0,  0,  0,  0,  0,  0,  4, -3,  0,  0,  0,  0,  0,  2 },
21999           {  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  0,  2 },
22000           {  0,  0,  0,  0,  0,  0,  5,-10,  0,  0,  0,  0,  0, -2 },
22001           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0,  1 },
22002           {  0,  0,  2, -2,  1, -1,  0,  2,  0,  0,  0,  0,  0,  0 },
22003           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0,  2,  0,  0 },
22004 
22005        /* 331-340 */
22006           {  0,  0,  0,  0,  1,  0,  3, -5,  0,  0,  0,  0,  0,  0 },
22007           {  1,  0,  0, -2,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22008           {  0,  0,  2, -2,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22009           {  0,  0,  0,  0,  0,  0,  9, -9,  0,  0,  0,  0,  0,  0 },
22010           {  0,  0,  2,  0,  2,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22011           {  0,  0,  2, -2,  1,  0,  0, -8, 11,  0,  0,  0,  0,  0 },
22012           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  0,  2,  0,  0,  0 },
22013           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -1,  2,  0,  0,  0 },
22014           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0,  2 },
22015           {  0,  0,  0,  0,  0,  0,  2, -6,  0,  0,  0,  0,  0, -2 },
22016 
22017        /* 341-350 */
22018           {  0,  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0, -1 },
22019           {  0,  0,  0,  0,  0,  0,  0,  5, -2,  0,  0,  0,  0,  2 },
22020           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  2 },
22021           {  0,  0,  0,  0,  0,  0,  0,  7,-13,  0,  0,  0,  0, -2 },
22022           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -2,  0,  0,  0,  0 },
22023           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  3,  0,  0,  0,  2 },
22024           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22025           {  0,  0,  0,  0,  0,  0,  8, -8,  0,  0,  0,  0,  0, -1 },
22026           {  0,  0,  0,  0,  0,  0,  8,-10,  0,  0,  0,  0,  0, -1 },
22027           {  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  0,  1 },
22028 
22029        /* 351-360 */
22030           {  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0, -1 },
22031           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0, -1 },
22032           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  2 },
22033           {  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0,  2 },
22034           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -4,  0,  0,  0,  0 },
22035           {  2,  0,  0, -2, -1,  0,  0, -5,  6,  0,  0,  0,  0,  0 },
22036           {  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0,  0, -2 },
22037           {  2,  0, -1, -1, -1,  0,  0,  3, -7,  0,  0,  0,  0,  0 },
22038           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0 },
22039           {  0,  0,  2,  0,  2,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
22040 
22041        /* 361-370 */
22042           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  4, -3,  0,  0,  0 },
22043           {  0,  0,  0,  0,  0,  0,  0,  6,-11,  0,  0,  0,  0,  0 },
22044           {  2,  0,  0, -2,  1,  0,  0, -6,  8,  0,  0,  0,  0,  0 },
22045           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  1,  5,  0,  0, -2 },
22046           {  0,  0,  0,  0,  0,  0,  0,  6, -5,  0,  0,  0,  0,  2 },
22047           {  1,  0, -2, -2, -2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22048           {  0,  0,  1, -1,  2,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
22049           {  0,  0,  0,  0,  2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22050           {  0,  0,  0,  0,  2,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22051           {  0,  0,  0,  0,  0,  0,  0,  6,  0,  0,  0,  0,  0,  1 },
22052 
22053        /* 371-380 */
22054           {  0,  0,  0,  0,  0,  0,  0,  6, -7,  0,  0,  0,  0,  2 },
22055           {  0,  0,  0,  0,  0,  0,  0,  4,  0,  0, -2,  0,  0,  2 },
22056           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  0, -2,  0,  0,  2 },
22057           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0,  1 },
22058           {  0,  0,  0,  0,  0,  0,  0,  1, -6,  0,  0,  0,  0, -2 },
22059           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  2 },
22060           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  2 },
22061           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  2,  0,  0,  0,  0 },
22062           {  0,  0,  0,  0,  0,  0,  0,  7,-13,  0,  0,  0,  0,  0 },
22063           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  0,  0,  0,  2 },
22064 
22065        /* 381-390 */
22066           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0,  2,  0,  0,  0 },
22067           {  0,  0,  0,  0,  1,  0,  0, -8, 15,  0,  0,  0,  0,  0 },
22068           {  2,  0,  0, -2, -2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22069           {  2,  0, -1, -1, -1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
22070           {  1,  0,  2, -2,  2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22071           {  1,  0, -1,  1, -1,  0,-18, 17,  0,  0,  0,  0,  0,  0 },
22072           {  0,  0,  2,  0,  2,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22073           {  0,  0,  2,  0,  2,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22074           {  0,  0,  2, -2, -1,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
22075           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22076 
22077        /* 391-400 */
22078           {  0,  0,  0,  0,  1,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
22079           {  0,  0,  0,  0,  0,  0,  8,-16,  0,  0,  0,  0,  0, -2 },
22080           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  5,  0,  0,  2 },
22081           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  2 },
22082           {  0,  0,  0,  0,  2,  0,  0, -1,  2,  0,  0,  0,  0,  0 },
22083           {  2,  0, -1, -1, -2,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
22084           {  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0,  0, -1 },
22085           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -2,  4,  0,  0,  0 },
22086           {  0,  0,  0,  0,  0,  0,  0,  2,  2,  0,  0,  0,  0,  2 },
22087           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  4, -5,  0,  0,  0 },
22088 
22089        /* 401-410 */
22090           {  2,  0,  0, -2, -1,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22091           {  2,  0, -1, -1, -1,  0,  0, -1,  0,  0,  0,  0,  0,  0 },
22092           {  1,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0,  0,  0,  0 },
22093           {  1,  0,  0, -1, -1,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22094           {  1,  0, -1, -1, -1,  0, 20,-20,  0,  0,  0,  0,  0,  0 },
22095           {  0,  0,  2, -2,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22096           {  0,  0,  1, -1,  1,  0,  1, -2,  0,  0,  0,  0,  0,  0 },
22097           {  0,  0,  1, -1,  1,  0, -2,  1,  0,  0,  0,  0,  0,  0 },
22098           {  0,  0,  0,  0,  1,  0,  5, -8,  0,  0,  0,  0,  0,  0 },
22099           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  0, -1,  0,  0,  0 },
22100 
22101        /* 411-420 */
22102           {  0,  0,  0,  0,  0,  0,  9,-11,  0,  0,  0,  0,  0, -1 },
22103           {  0,  0,  0,  0,  0,  0,  5, -3,  0,  0,  0,  0,  0,  1 },
22104           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  0,  0,  0, -1 },
22105           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  1 },
22106           {  0,  0,  0,  0,  0,  0,  6, -7,  0,  0,  0,  0,  0,  0 },
22107           {  0,  0,  0,  0,  0,  0,  0,  3, -2,  0,  0,  0,  0,  0 },
22108           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0, -2 },
22109           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0, -2,  0,  0,  0 },
22110           {  0,  0,  1, -1,  2,  0,  0, -1,  0, -2,  5,  0,  0,  0 },
22111           {  0,  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0 },
22112 
22113        /* 421-430 */
22114           {  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0,  0 },
22115           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0, -2 },
22116           {  0,  0,  0,  0,  0,  0,  0,  2, -6,  0,  0,  0,  0, -2 },
22117           {  1,  0,  0, -2,  0,  0, 20,-21,  0,  0,  0,  0,  0,  0 },
22118           {  0,  0,  0,  0,  0,  0,  8,-12,  0,  0,  0,  0,  0,  0 },
22119           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0,  0 },
22120           {  0,  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0 },
22121           {  0,  0,  1, -1,  2,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
22122           {  0,  0,  0,  0,  0,  0,  8,-12,  0,  0,  0,  0,  0, -2 },
22123           {  0,  0,  0,  0,  0,  0,  0,  9,-17,  0,  0,  0,  0,  0 },
22124 
22125        /* 431-440 */
22126           {  0,  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  2 },
22127           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  1,  5,  0,  0,  2 },
22128           {  0,  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0, -2 },
22129           {  0,  0,  0,  0,  0,  0,  0,  2, -7,  0,  0,  0,  0, -2 },
22130           {  1,  0,  0, -1,  1,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
22131           {  1,  0, -2,  0, -2,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
22132           {  0,  0,  0,  0,  1,  0,  0, -9, 17,  0,  0,  0,  0,  0 },
22133           {  0,  0,  0,  0,  0,  0,  1, -4,  0,  0,  0,  0,  0, -2 },
22134           {  1,  0, -2, -2, -2,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22135           {  1,  0, -1,  1, -1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22136 
22137        /* 441-450 */
22138           {  0,  0,  2, -2,  2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22139           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  0,  1,  0,  0,  0 },
22140           {  0,  0,  1, -1,  2,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
22141           {  0,  0,  0,  0,  1,  0,  0,  2, -2,  0,  0,  0,  0,  0 },
22142           {  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0, -1 },
22143           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0, -2 },
22144           {  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0,  0 },
22145           {  0,  0,  0,  0,  0,  0,  0,  5,-10,  0,  0,  0,  0, -2 },
22146           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -4,  0,  0,  0,  2 },
22147           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -5,  0,  0,  0, -2 },
22148 
22149        /* 451-460 */
22150           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -5,  0,  0,  0, -2 },
22151           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -2,  5,  0,  0,  2 },
22152           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -2,  0,  0,  0, -2 },
22153           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0,  1 },
22154           {  1,  0,  0, -2,  0,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22155           {  0,  0,  0,  0,  0,  0,  3, -7,  4,  0,  0,  0,  0,  0 },
22156           {  2,  0,  2,  0,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22157           {  0,  0,  1, -1, -1,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
22158           {  0,  0,  0,  0,  1,  0,  0,  1,  0, -2,  0,  0,  0,  0 },
22159           {  0,  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0, -2 },
22160 
22161        /* 461-470 */
22162           {  1,  0,  0, -1,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22163           {  0,  0,  2, -2,  1,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22164           {  0,  0,  2, -2,  1,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22165           {  0,  0,  2, -2,  1,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22166           {  0,  0,  2, -2,  1,  0,  0, -3,  0,  3,  0,  0,  0,  0 },
22167           {  0,  0,  2, -2,  1,  0, -5,  5,  0,  0,  0,  0,  0,  0 },
22168           {  0,  0,  1, -1,  1,  0,  1, -3,  0,  0,  0,  0,  0,  0 },
22169           {  0,  0,  1, -1,  1,  0,  0, -4,  6,  0,  0,  0,  0,  0 },
22170           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0, -1,  0,  0 },
22171           {  0,  0,  1, -1,  1,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
22172 
22173        /* 471-480 */
22174           {  0,  0,  0,  0,  1,  0,  3, -4,  0,  0,  0,  0,  0,  0 },
22175           {  0,  0,  0,  0,  1,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22176           {  0,  0,  0,  0,  0,  0,  7,-10,  0,  0,  0,  0,  0, -1 },
22177           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0,  1 },
22178           {  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0, -2 },
22179           {  0,  0,  0,  0,  0,  0,  3, -8,  0,  0,  0,  0,  0, -2 },
22180           {  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0,  0,  0, -1 },
22181           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0, -1 },
22182           {  0,  0,  0,  0,  0,  0,  0,  7, -9,  0,  0,  0,  0,  2 },
22183           {  0,  0,  0,  0,  0,  0,  0,  7, -8,  0,  0,  0,  0,  2 },
22184 
22185        /* 481-490 */
22186           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  0,  0,  2 },
22187           {  0,  0,  0,  0,  0,  0,  0,  3, -8,  3,  0,  0,  0, -2 },
22188           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -2,  0,  0,  1 },
22189           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  1 },
22190           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0, -1 },
22191           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0, -1 },
22192           {  2,  0,  0, -2, -1,  0,  0, -6,  8,  0,  0,  0,  0,  0 },
22193           {  2,  0, -1, -1,  1,  0,  0,  3, -7,  0,  0,  0,  0,  0 },
22194           {  0,  0,  2, -2,  1,  0,  0, -7,  9,  0,  0,  0,  0,  0 },
22195           {  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0, -1 },
22196 
22197        /* 491-500 */
22198           {  0,  0,  1, -1,  2,  0, -8, 12,  0,  0,  0,  0,  0,  0 },
22199           {  1,  0,  0,  0,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22200           {  1,  0,  0, -2,  0,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
22201           {  0,  0,  0,  0,  0,  0,  7, -8,  0,  0,  0,  0,  0,  0 },
22202           {  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0 },
22203           {  2,  0,  0, -2,  1,  0,  0, -5,  6,  0,  0,  0,  0,  0 },
22204           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  3, -1,  0,  0,  0 },
22205           {  1,  0,  1,  1,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22206           {  1,  0,  0, -2,  1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22207           {  1,  0,  0, -2, -1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22208 
22209        /* 501-510 */
22210           {  1,  0,  0, -1, -1,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
22211           {  1,  0, -1,  0, -1,  0, -3,  5,  0,  0,  0,  0,  0,  0 },
22212           {  0,  0,  2, -2,  1,  0,  0, -4,  4,  0,  0,  0,  0,  0 },
22213           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  0,  0,  0,  0,  0 },
22214           {  0,  0,  2, -2,  1,  0, -8, 11,  0,  0,  0,  0,  0,  0 },
22215           {  0,  0,  2, -2,  0,  0,  0, -9, 13,  0,  0,  0,  0,  0 },
22216           {  0,  0,  1,  1,  2,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22217           {  0,  0,  1, -1,  1,  0,  0,  1, -4,  0,  0,  0,  0,  0 },
22218           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  1, -3,  0,  0,  0 },
22219           {  0,  0,  0,  0,  1,  0,  0,  7,-13,  0,  0,  0,  0,  0 },
22220 
22221        /* 511-520 */
22222           {  0,  0,  0,  0,  1,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22223           {  0,  0,  0,  0,  1,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22224           {  0,  0,  0,  0,  1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
22225           {  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0,  0,  0,  0 },
22226           {  0,  0,  0,  0,  0,  0,  7,-11,  0,  0,  0,  0,  0, -1 },
22227           {  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  0,  1 },
22228           {  0,  0,  0,  0,  0,  0,  6, -4,  0,  0,  0,  0,  0,  1 },
22229           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0, -1 },
22230           {  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  0,  0 },
22231           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0,  1 },
22232 
22233        /* 521-530 */
22234           {  0,  0,  0,  0,  0,  0,  1, -4,  0,  0,  0,  0,  0, -1 },
22235           {  0,  0,  0,  0,  0,  0,  0,  9,-17,  0,  0,  0,  0, -2 },
22236           {  0,  0,  0,  0,  0,  0,  0,  7, -7,  0,  0,  0,  0,  2 },
22237           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0,  1 },
22238           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0, -1 },
22239           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  0,  0,  0,  0,  0 },
22240           {  0,  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0, -1 },
22241           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  0,  0,  1 },
22242           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0,  0 },
22243           {  2,  0,  0, -2,  0,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22244 
22245        /* 531-540 */
22246           {  2,  0,  0, -2,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22247           {  1,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22248           {  1,  0,  0,  0,  0,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22249           {  1,  0,  0,  0,  0,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
22250           {  1,  0,  0, -2,  0,  0, 17,-16,  0, -2,  0,  0,  0,  0 },
22251           {  1,  0,  0, -1,  0,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22252           {  0,  0,  2, -2,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22253           {  0,  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0 },
22254           {  0,  0,  0,  0,  0,  0,  0,  4,  0,  0,  0,  0,  0,  0 },
22255           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -4,  0,  0,  0,  0 },
22256 
22257        /* 541-550 */
22258           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1, -2, -2 },
22259           {  0,  0,  0,  0,  0,  0,  0,  2,  1,  0,  0,  0,  0,  2 },
22260           {  2,  0,  0, -2,  0,  0,  0, -4,  4,  0,  0,  0,  0,  0 },
22261           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  2,  2,  0,  0,  0 },
22262           {  1,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22263           {  1,  0,  0,  0,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22264           {  1,  0,  0,  0,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22265           {  1,  0,  0, -2,  0,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22266           {  1,  0,  0, -2,  0,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22267           {  1,  0,  0, -2,  0,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22268 
22269        /* 551-560 */
22270           {  1,  0,  0, -2,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22271           {  0,  0,  2, -2,  0,  0, -4,  4,  0,  0,  0,  0,  0,  0 },
22272           {  0,  0,  1,  1,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22273           {  0,  0,  1, -1,  0,  0,  3, -6,  0,  0,  0,  0,  0,  0 },
22274           {  0,  0,  1, -1,  0,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22275           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22276           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0,  1,  0,  0,  0 },
22277           {  0,  0,  1, -1,  0,  0, -4,  5,  0,  0,  0,  0,  0,  0 },
22278           {  0,  0,  1, -1,  0,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
22279           {  0,  0,  0,  2,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22280 
22281        /* 561-570 */
22282           {  0,  0,  0,  0,  0,  0,  8, -9,  0,  0,  0,  0,  0,  0 },
22283           {  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0,  0 },
22284           {  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  0,  0 },
22285           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0 },
22286           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0 },
22287           {  2,  0, -2, -2, -2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22288           {  1,  0,  0,  0,  1,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
22289           {  1,  0,  0,  0, -1,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
22290           {  0,  0,  2,  0,  2,  0,  2, -3,  0,  0,  0,  0,  0,  0 },
22291           {  0,  0,  2,  0,  2,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
22292 
22293        /* 571-580 */
22294           {  0,  0,  2,  0,  2,  0, -2,  3,  0,  0,  0,  0,  0,  0 },
22295           {  0,  0,  2,  0,  2,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22296           {  0,  0,  0,  0,  2,  0,  0,  0,  0,  1,  0,  0,  0,  0 },
22297           {  0,  0,  0,  0,  1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
22298           {  2,  0,  2, -2,  2,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22299           {  2,  0,  1, -3,  1,  0, -6,  7,  0,  0,  0,  0,  0,  0 },
22300           {  2,  0,  0, -2,  0,  0,  2, -5,  0,  0,  0,  0,  0,  0 },
22301           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  5, -5,  0,  0,  0 },
22302           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  1,  5,  0,  0,  0 },
22303           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  0,  5,  0,  0,  0 },
22304 
22305        /* 581-590 */
22306           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  0,  2,  0,  0,  0 },
22307           {  2,  0,  0, -2,  0,  0, -4,  4,  0,  0,  0,  0,  0,  0 },
22308           {  2,  0, -2,  0, -2,  0,  0,  5, -9,  0,  0,  0,  0,  0 },
22309           {  2,  0, -1, -1,  0,  0,  0, -1,  0,  3,  0,  0,  0,  0 },
22310           {  1,  0,  2,  0,  2,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22311           {  1,  0,  2,  0,  2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22312           {  1,  0,  2,  0,  2,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22313           {  1,  0,  2,  0,  2,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
22314           {  1,  0,  2, -2,  2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22315           {  1,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22316 
22317        /* 591-600 */
22318           {  1,  0,  0,  0,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22319           {  1,  0,  0, -2,  0,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22320           {  1,  0, -2, -2, -2,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22321           {  1,  0, -1,  1,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22322           {  1,  0, -1, -1,  0,  0,  0,  8,-15,  0,  0,  0,  0,  0 },
22323           {  0,  0,  2,  2,  2,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22324           {  0,  0,  2, -2,  1,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22325           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  1,  0,  0,  0,  0 },
22326           {  0,  0,  2, -2,  1,  0,  0,-10, 15,  0,  0,  0,  0,  0 },
22327           {  0,  0,  2, -2,  0, -1,  0,  2,  0,  0,  0,  0,  0,  0 },
22328 
22329        /* 601-610 */
22330           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  0, -1,  0,  0,  0 },
22331           {  0,  0,  1, -1,  2,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
22332           {  0,  0,  1, -1,  1,  0, -4,  6,  0,  0,  0,  0,  0,  0 },
22333           {  0,  0,  1, -1,  1,  0, -1,  2,  0,  0,  0,  0,  0,  0 },
22334           {  0,  0,  1, -1,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22335           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0, -2,  0,  0,  0 },
22336           {  0,  0,  1, -1,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22337           {  0,  0,  1, -1,  0,  0, -1,  0,  0,  0,  0,  0,  0,  0 },
22338           {  0,  0,  1, -1, -1,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
22339           {  0,  0,  0,  2,  0,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22340 
22341        /* 611-620 */
22342           {  0,  0,  0,  2,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22343           {  0,  0,  0,  0,  2,  0, -3,  5,  0,  0,  0,  0,  0,  0 },
22344           {  0,  0,  0,  0,  1,  0, -1,  2,  0,  0,  0,  0,  0,  0 },
22345           {  0,  0,  0,  0,  0,  0,  9,-13,  0,  0,  0,  0,  0, -2 },
22346           {  0,  0,  0,  0,  0,  0,  8,-14,  0,  0,  0,  0,  0, -2 },
22347           {  0,  0,  0,  0,  0,  0,  8,-11,  0,  0,  0,  0,  0, -1 },
22348           {  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0,  0 },
22349           {  0,  0,  0,  0,  0,  0,  6, -8,  0,  0,  0,  0,  0,  0 },
22350           {  0,  0,  0,  0,  0,  0,  6, -7,  0,  0,  0,  0,  0, -1 },
22351           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0, -2 },
22352 
22353        /* 621-630 */
22354           {  0,  0,  0,  0,  0,  0,  5, -6, -4,  0,  0,  0,  0, -2 },
22355           {  0,  0,  0,  0,  0,  0,  5, -4,  0,  0,  0,  0,  0,  2 },
22356           {  0,  0,  0,  0,  0,  0,  4, -8,  0,  0,  0,  0,  0, -2 },
22357           {  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0,  0 },
22358           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  2,  0,  0,  0,  2 },
22359           {  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  0,  0 },
22360           {  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0,  0 },
22361           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0, -2 },
22362           {  0,  0,  0,  0,  0,  0,  0,  7,-12,  0,  0,  0,  0, -2 },
22363           {  0,  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0, -2 },
22364 
22365        /* 631-640 */
22366           {  0,  0,  0,  0,  0,  0,  0,  6, -8,  1,  5,  0,  0,  2 },
22367           {  0,  0,  0,  0,  0,  0,  0,  6, -4,  0,  0,  0,  0,  2 },
22368           {  0,  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0,  0 },
22369           {  0,  0,  0,  0,  0,  0,  0,  5,  0, -4,  0,  0,  0,  2 },
22370           {  0,  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0, -1 },
22371           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  3,  0,  0,  0,  2 },
22372           {  0,  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0, -2 },
22373           {  0,  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0 },
22374           {  0,  0,  0,  0,  0,  0,  0,  5,-16,  4,  5,  0,  0, -2 },
22375           {  0,  0,  0,  0,  0,  0,  0,  5,-13,  0,  0,  0,  0, -2 },
22376 
22377        /* 641-650 */
22378           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -5,  0,  0,  0, -2 },
22379           {  0,  0,  0,  0,  0,  0,  0,  3, -9,  0,  0,  0,  0, -2 },
22380           {  0,  0,  0,  0,  0,  0,  0,  3, -7,  0,  0,  0,  0, -2 },
22381           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  2,  0,  0,  0,  2 },
22382           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -3,  0,  0,  0 },
22383           {  0,  0,  0,  0,  0,  0,  0,  2, -8,  1,  5,  0,  0, -2 },
22384           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1, -5,  0,  0,  0 },
22385           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  2,  0,  0,  2 },
22386           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -3,  0,  0,  0 },
22387           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  5,  0,  0,  0 },
22388 
22389        /* 651-NFPL */
22390           {  0,  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0 },
22391           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -6,  3,  0, -2 },
22392           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0 },
22393           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0 },
22394           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2 },
22395           {  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0 }
22396        };
22397 
22398       /**
22399        *
22400        *  Time scale transformation:  Terrestrial Time, TT, to International
22401        *  Atomic Time, TAI.
22402        *
22403        * <p>This function is derived from the International Astronomical Union's
22404        *  SOFA (Standards of Fundamental Astronomy) software collection.
22405        *
22406        *<p>Status:  canonical.
22407        *
22408        *<!-- Given: -->
22409        *    @param tt1    double    TT as a 2-part Julian Date
22410        *    @param tt2    double    TT as a 2-part Julian Date
22411        *
22412        *<!-- Returned:-->
22413        *     @return   TAI as a 2-part Julian Date
22414        *
22415        *  Returned (function value):
22416        *                int       status:  0 = OK
22417        *
22418        *  Note:
22419        *
22420        *     tt1+tt2 is Julian Date, apportioned in any convenient way between
22421        *     the two arguments, for example where tt1 is the Julian Day Number
22422        *     and tt2 is the fraction of a day.  The returned tai1,tai2 follow
22423        *     suit.
22424        *
22425        *<p>References:
22426        *
22427        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22428        *     IERS Technical Note No. 32, BKG (2004)
22429        *
22430        *     Explanatory Supplement to the Astronomical Almanac,
22431        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22432        *
22433        *@version 2010 May 13
22434        *
22435        *@since SOFA release 2010-12-01
22436        *
22437        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22438        */
22439       public static JulianDate jauTttai(double tt1, double tt2)
22440       {
22441           double tai1, tai2;
22442           /* TT minus TAI (days). */
22443           final double dtat = TTMTAI / 86400.0;
22444 
22445 
22446           /* Result, safeguarding precision. */
22447           if ( abs(tt1) > abs(tt2) ) {
22448               tai1 = tt1;
22449               tai2 = tt2 - dtat;
22450           } else {
22451               tai1 = tt1 - dtat;
22452               tai2 = tt2;
22453           }
22454 
22455           return new JulianDate(tai1, tai2);
22456 
22457       };
22458 
22459       /**
22460        *
22461        *  Time scale transformation:  Terrestrial Time, TT, to Geocentric
22462        *  Coordinate Time, TCG.
22463        *
22464        * <p>This function is derived from the International Astronomical Union's
22465        *  SOFA (Standards of Fundamental Astronomy) software collection.
22466        *
22467        *<p>Status:  canonical.
22468        *
22469        *<!-- Given: -->
22470        *     @param tt1 double    TT as a 2-part Julian Date
22471        *     @param tt2 double    TT as a 2-part Julian Date
22472        *
22473        *<!-- Returned:-->
22474        *     @return   TCG as a 2-part Julian Date
22475        *
22476        *  Returned (function value):
22477        *                int       status:  0 = OK
22478        *
22479        *  Note:
22480        *
22481        *     tt1+tt2 is Julian Date, apportioned in any convenient way between
22482        *     the two arguments, for example where tt1 is the Julian Day Number
22483        *     and tt2 is the fraction of a day.  The returned tcg1,tcg2 follow
22484        *     suit.
22485        *
22486        *<p>References:
22487        *
22488        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22489        *     IERS Technical Note No. 32, BKG (2004)
22490        *
22491        *     IAU 2000 Resolution B1.9
22492        *
22493        *@version 2010 May 13
22494        *
22495        *@since SOFA release 2010-12-01
22496        *
22497        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22498        */
22499       public static JulianDate jauTttcg(double tt1, double tt2)
22500 
22501       {
22502           double tcg1, tcg2;
22503 
22504           /* 1977 Jan 1 00:00:32.184 TT, as MJD */
22505           final double t77t = DJM77 + TTMTAI/DAYSEC;
22506 
22507           /* TT to TCG rate */
22508           final double elgg = ELG/(1.0-ELG);
22509 
22510 
22511           /* Result, safeguarding precision. */
22512           if ( abs(tt1) > abs(tt2) ) {
22513               tcg1 = tt1;
22514               tcg2 = tt2 + ( ( tt1 - DJM0 ) + ( tt2 - t77t ) ) * elgg;
22515           } else {
22516               tcg1 = tt1 + ( ( tt2 - DJM0 ) + ( tt1 - t77t ) ) * elgg;
22517               tcg2 = tt2;
22518           }
22519 
22520           return new JulianDate(tcg1, tcg2);
22521 
22522       };      
22523 
22524       /**
22525        *
22526        *  Time scale transformation:  Terrestrial Time, TT, to Barycentric
22527        *  Dynamical Time, TDB.
22528        *
22529        * <p>This function is derived from the International Astronomical Union's
22530        *  SOFA (Standards of Fundamental Astronomy) software collection.
22531        *
22532        *<p>Status:  canonical.
22533        *
22534        *<!-- Given: -->
22535        *     @param tt1    double    TT as a 2-part Julian Date
22536        *     @param tt2    double    TT as a 2-part Julian Date
22537        *     @param dtr        double    TDB-TT in seconds
22538        *
22539        *<!-- Returned:-->
22540        *     @return   TDB as a 2-part Julian Date
22541        *
22542        *  Returned (function value):
22543        *                int       status:  0 = OK
22544        *
22545        *<p>Notes:
22546        *
22547        *  1  tt1+tt2 is Julian Date, apportioned in any convenient way between
22548        *     the two arguments, for example where tt1 is the Julian Day Number
22549        *     and tt2 is the fraction of a day.  The returned tdb1,tdb2 follow
22550        *     suit.
22551        *
22552        *  2  The argument dtr represents the quasi-periodic component of the
22553        *     GR transformation between TT and TCB.  It is dependent upon the
22554        *     adopted solar-system ephemeris, and can be obtained by numerical
22555        *     integration, by interrogating a precomputed time ephemeris or by
22556        *     evaluating a model such as that implemented in the SOFA function
22557        *     jauDtdb.   The quantity is dominated by an annual term of 1.7 ms
22558        *     amplitude.
22559        *
22560        *  3  TDB is essentially the same as Teph, the time argument for the JPL
22561        *     solar system ephemerides.
22562        *
22563        *<p>References:
22564        *
22565        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22566        *     IERS Technical Note No. 32, BKG (2004)
22567        *
22568        *     IAU 2006 Resolution 3
22569        *
22570        *@version 2010 May 13
22571        *
22572        *@since SOFA release 2010-12-01
22573        *
22574        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22575        */
22576       public static JulianDate jauTttdb(double tt1, double tt2, double dtr)
22577       {
22578 
22579           double tdb1, tdb2;
22580           double dtrd;
22581 
22582 
22583           /* Result, safeguarding precision. */
22584           dtrd = dtr / DAYSEC;
22585           if ( abs(tt1) > abs(tt2) ) {
22586               tdb1 = tt1;
22587               tdb2 = tt2 + dtrd;
22588           } else {
22589               tdb1 = tt1 + dtrd;
22590               tdb2 = tt2;
22591           }
22592 
22593           return new JulianDate(tdb1, tdb2);
22594 
22595       };
22596 
22597       /**
22598        *
22599        *  Time scale transformation:  Terrestrial Time, TT, to Universal Time,
22600        *  UT1.
22601        *
22602        * <p>This function is derived from the International Astronomical Union's
22603        *  SOFA (Standards of Fundamental Astronomy) software collection.
22604        *
22605        *<p>Status:  canonical.
22606        *
22607        *<!-- Given: -->
22608        *    @param tt1    double    TT as a 2-part Julian Date
22609        *    @param tt2    double    TT as a 2-part Julian Date
22610        *    @param dt         double    TT-UT1 in seconds
22611        *
22612        *<!-- Returned:-->
22613        *     @return   UT1 as a 2-part Julian Date
22614        *
22615        *  Returned (function value):
22616        *                int       status:  0 = OK
22617        *
22618        *<p>Notes:
22619        *
22620        *  1  tt1+tt2 is Julian Date, apportioned in any convenient way between
22621        *     the two arguments, for example where tt1 is the Julian Day Number
22622        *     and tt2 is the fraction of a day.  The returned ut11,ut12 follow
22623        *     suit.
22624        *
22625        *  2  The argument dt is classical Delta T.
22626        *
22627        *  Reference:
22628        *
22629        *     Explanatory Supplement to the Astronomical Almanac,
22630        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22631        *
22632        *@version 2010 May 16
22633        *
22634        *@since SOFA release 2010-12-01
22635        *
22636        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22637        */
22638       public static JulianDate jauTtut1(double tt1, double tt2, double dt)
22639 
22640       {
22641 
22642           double ut11, ut12;
22643           double dtd;
22644 
22645 
22646           /* Result, safeguarding precision. */
22647           dtd = dt / DAYSEC;
22648           if ( abs(tt1) > abs(tt2) ) {
22649               ut11 = tt1;
22650               ut12 = tt2 - dtd;
22651           } else {
22652               ut11 = tt1 - dtd;
22653               ut12 = tt2;
22654           }
22655 
22656           return new JulianDate(ut11, ut12);
22657       };
22658 
22659       /**
22660        *
22661        *  Time scale transformation:  Universal Time, UT1, to International
22662        *  Atomic Time, TAI.
22663        *
22664        * <p>This function is derived from the International Astronomical Union's
22665        *  SOFA (Standards of Fundamental Astronomy) software collection.
22666        *
22667        *<p>Status:  canonical.
22668        *
22669        *<!-- Given: -->
22670        *   @param  ut11  double    UT1 as a 2-part Julian Date
22671        *   @param  ut12  double    UT1 as a 2-part Julian Date
22672        *   @param  dta        double    UT1-TAI in seconds
22673        *
22674        *<!-- Returned:-->
22675        *    @return    TAI as a 2-part Julian Date
22676        *
22677        *  Returned (function value):
22678        *                int       status:  0 = OK
22679        *
22680        *<p>Notes:
22681        *
22682        *  1  ut11+ut12 is Julian Date, apportioned in any convenient way
22683        *     between the two arguments, for example where ut11 is the Julian
22684        *     Day Number and ut12 is the fraction of a day.  The returned
22685        *     TAI1,TAI2 follow suit.
22686        *
22687        *  2  The argument dta, i.e. UT1-TAI, is an observed quantity, and is
22688        *     available from IERS tabulations.
22689        *
22690        *  Reference:
22691        *
22692        *     Explanatory Supplement to the Astronomical Almanac,
22693        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22694        *
22695        *@version 2010 May 16
22696        *
22697        *@since SOFA release 2010-12-01
22698        *
22699        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22700        */
22701       public static JulianDate jauUt1tai(double ut11, double ut12, double dta )
22702 
22703       {
22704           double tai1, tai2;
22705           double dtad;
22706 
22707 
22708           /* Result, safeguarding precision. */
22709           dtad = dta / DAYSEC;
22710           if ( abs(ut11) > abs(ut12) ) {
22711               tai1 = ut11;
22712               tai2 = ut12 - dtad;
22713           } else {
22714               tai1 = ut11 - dtad;
22715               tai2 = ut12;
22716           }
22717           return new JulianDate(tai1, tai2);
22718 
22719       };
22720 
22721       /**
22722        *
22723        *  Time scale transformation:  Universal Time, UT1, to Terrestrial
22724        *  Time, TT.
22725        *
22726        * <p>This function is derived from the International Astronomical Union's
22727        *  SOFA (Standards of Fundamental Astronomy) software collection.
22728        *
22729        *<p>Status:  canonical.
22730        *
22731        *<!-- Given: -->
22732        *   @param  ut11  double    UT1 as a 2-part Julian Date
22733        *   @param  ut12  double    UT1 as a 2-part Julian Date
22734        *   @param  dt         double    TT-UT1 in seconds
22735        *
22736        *<!-- Returned:-->
22737        *     @return    TAI as a 2-part Julian Date
22738        *
22739        *  Returned (function value):
22740        *                int       status:  0 = OK
22741        *
22742        *<p>Notes:
22743        *
22744        *  1  ut11+ut12 is Julian Date, apportioned in any convenient way
22745        *     between the two arguments, for example where ut11 is the Julian
22746        *     Day Number and ut12 is the fraction of a day.  The returned
22747        *     tt1,tt2 follow suit.
22748        *
22749        *  2  The argument dt is classical Delta T.
22750        *
22751        *  Reference:
22752        *
22753        *     Explanatory Supplement to the Astronomical Almanac,
22754        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22755        *
22756        *@version 2010 May 16
22757        *
22758        *@since SOFA release 2010-12-01
22759        *
22760        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22761        */
22762       public static JulianDate jauUt1tt(double ut11, double ut12, double dt)
22763       {
22764 
22765           double tt1, tt2;
22766           double dtd;
22767 
22768 
22769           /* Result, safeguarding precision. */
22770           dtd = dt / DAYSEC;
22771           if ( abs(ut11) > abs(ut12) ) {
22772               tt1 = ut11;
22773               tt2 = ut12 + dtd;
22774           } else {
22775               tt1 = ut11 + dtd;
22776               tt2 = ut12;
22777           }
22778 
22779           return new JulianDate(tt1, tt2);
22780 
22781       };
22782 
22783       /**
22784        *
22785        *  Time scale transformation:  Universal Time, UT1, to Coordinated
22786        *  Universal Time, UTC.
22787        *
22788        * <p>This function is derived from the International Astronomical Union's
22789        *  SOFA (Standards of Fundamental Astronomy) software collection.
22790        *
22791        *<p>Status:  canonical.
22792        *
22793        *<!-- Given: -->
22794        *  @param ut11 double   UT1 as a 2-part Julian Date (Note 1)
22795        *  @param ut12 double   UT1 as a 2-part Julian Date (Note 1) 
22796        *  @param   dut1       double   Delta UT1: UT1-UTC in seconds (Note 2)
22797        *
22798        *<!-- Returned:-->
22799        *     @return  JulianDate   UTC as a 2-part quasi Julian Date (Notes 3,4)
22800        *
22801        *  Returned (function value):
22802        *                int      status: +1 = dubious year (Note 5)
22803        *                                  0 = OK
22804        *                                 -1 = unacceptable date
22805        *
22806        *<p>Notes:
22807        *<ol>
22808        *  <li>  ut11+ut12 is Julian Date, apportioned in any convenient way
22809        *     between the two arguments, for example where ut11 is the Julian
22810        *     Day Number and ut12 is the fraction of a day.  The returned utc1
22811        *     and utc2 form an analogous pair, except that a special convention
22812        *     is used, to deal with the problem of leap seconds - see Note 3.
22813        *
22814        *  <li> Delta UT1 can be obtained from tabulations provided by the
22815        *     International Earth Rotation and Reference Systems Service.  The
22816        *     value changes abruptly by 1s at a leap second;  however, close to
22817        *     a leap second the algorithm used here is tolerant of the "wrong"
22818        *     choice of value being made.
22819        *
22820        *  <li> JD cannot unambiguously represent UTC during a leap second unless
22821        *     special measures are taken.  The convention in the present
22822        *     function is that the returned quasi JD day UTC1+UTC2 represents
22823        *     UTC days whether the length is 86399, 86400 or 86401 SI seconds.
22824        *
22825        *  <li> The function jauD2dtf can be used to transform the UTC quasi-JD
22826        *     into calendar date and clock time, including UTC leap second
22827        *     handling.
22828        *
22829        *  <li> The warning status "dubious year" flags UTCs that predate the
22830        *     introduction of the time scale and that are too far in the future
22831        *     to be trusted.  See jauDat for further details.
22832        *</ol>
22833        *  Called:
22834        *  <ul>
22835        *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
22836        *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
22837        *     <li>{@link #jauCal2jd}    Gregorian calendar to JD
22838        *</ul>
22839        *<p>References:
22840        *
22841        *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22842        *     IERS Technical Note No. 32, BKG (2004)
22843        *
22844        *     <p>Explanatory Supplement to the Astronomical Almanac,
22845        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22846        *
22847        *@version 2010 May 16
22848        *
22849        *@since SOFA release 2010-12-01
22850        *
22851        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22852        * @throws JSOFAIllegalParameter unacceptable date
22853        * @throws JSOFAInternalError an internal error has occured
22854        */
22855       public static JulianDate jauUt1utc(double ut11, double ut12, double dut1) throws JSOFAIllegalParameter, JSOFAInternalError
22856 
22857       {
22858 
22859           double utc1, utc2;
22860           boolean big1;
22861           int i;
22862           double duts, u1, u2, d1, dats1, d2, fd, dats2, ddats, us1, us2, du;
22863 
22864 
22865           /* UT1-UTC in seconds. */
22866           duts = dut1;
22867 
22868           /* Put the two parts of the UT1 into big-first order. */
22869           big1 = ( abs(ut11) >= abs(ut12) );
22870           if ( big1 ) {
22871               u1 = ut11;
22872               u2 = ut12;
22873           } else {
22874               u1 = ut12;
22875               u2 = ut11;
22876           }
22877 
22878           /* See if the UT1 can possibly be in a leap-second day. */
22879           d1 = u1;
22880           dats1 = 0;
22881           for ( i = -1; i <= 3; i++ ) {
22882               d2 = u2 + (double) i;
22883               Calendar dt = jauJd2cal(d1, d2 );
22884               dats2 = jauDat(dt.iy, dt.im, dt.id, 0.0);
22885               if ( i == - 1 ) dats1 = dats2;
22886               ddats = dats2 - dats1;
22887               if ( abs(ddats) >= 0.5 ) {
22888 
22889                   /* Yes, leap second nearby: ensure UT1-UTC is "before" value. */
22890                   if ( ddats * duts >= 0 ) duts -= ddats;
22891 
22892                   /* UT1 for the start of the UTC day that ends in a leap. */
22893                   JulianDate jd = jauCal2jd(dt.iy, dt.im, dt.id );
22894                   d1 = jd.djm0; d2 = jd.djm1;
22895                   us1 = d1;
22896                   us2 = d2 - 1.0 + duts/DAYSEC;
22897 
22898                   /* Is the UT1 after this point? */
22899                   du = u1 - us1;
22900                   du += u2 - us2;
22901                   if ( du > 0 ) {
22902 
22903                       /* Yes:  fraction of the current UTC day that has elapsed. */
22904                       fd = du * DAYSEC / ( DAYSEC + ddats );
22905 
22906                       /* Ramp UT1-UTC to bring about SOFA's JD(UTC) convention. */
22907                       duts += ddats * ( fd <= 1.0 ? fd : 1.0 );
22908                   }
22909 
22910                   /* Done. */
22911                   break;
22912               }
22913               dats1 = dats2;
22914           }
22915 
22916           /* Subtract the (possibly adjusted) UT1-UTC from UT1 to give UTC. */
22917           u2 -= duts / DAYSEC;
22918 
22919           /* Result, safeguarding precision. */
22920           if ( big1 ) {
22921               utc1 = u1;
22922               utc2 = u2;
22923           } else {
22924               utc1 = u2;
22925               utc2 = u1;
22926           }
22927 
22928           /* FIXME Status. */
22929           return new JulianDate(utc1, utc2);
22930 
22931       };
22932 
22933       /**
22934        *
22935        *  Time scale transformation:  Coordinated Universal Time, UTC, to
22936        *  International Atomic Time, TAI.
22937        *
22938        * <p>This function is derived from the International Astronomical Union's
22939        *  SOFA (Standards of Fundamental Astronomy) software collection.
22940        *
22941        *<p>Status:  canonical.
22942        *
22943        *<!-- Given: -->
22944        *     @param utc1 double   UTC as a 2-part quasi Julian Date (Notes 1-4)
22945        *     @param utc2 double   UTC as a 2-part quasi Julian Date (Notes 1-4) 
22946        *
22947        *<!-- Returned:-->
22948        *     @return JulianDate     TAI as a 2-part Julian Date (Note 5)
22949        *
22950        *  Returned (function value):
22951        *                int      status: +1 = dubious year (Note 3)
22952        *                                  0 = OK
22953        *                                 -1 = unacceptable date
22954        *
22955        *<p>Notes:
22956        *<ol>
22957        *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
22958        *     convenient way between the two arguments, for example where utc1
22959        *     is the Julian Day Number and utc2 is the fraction of a day.
22960        *
22961        *  <li> JD cannot unambiguously represent UTC during a leap second unless
22962        *     special measures are taken.  The convention in the present
22963        *     function is that the JD day represents UTC days whether the
22964        *     length is 86399, 86400 or 86401 SI seconds.
22965        *
22966        *  <li> The warning status "dubious year" flags UTCs that predate the
22967        *     introduction of the time scale and that are too far in the future
22968        *     to be trusted.  See jauDat  for further details.
22969        *
22970        *  <li> The function jauDtf2d converts from calendar date and time of day
22971        *     into 2-part Julian Date, and in the case of UTC implements the
22972        *     leap-second-ambiguity convention described above.
22973        *
22974        *  <li> The returned TAI1,TAI2 are such that their sum is the TAI Julian
22975        *     Date.
22976        *</ol>
22977        *  Called:<ul>
22978        *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
22979        *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
22980        *     <li>{@link #jauCal2jd}    Gregorian calendar to JD
22981        *</ul>
22982        *<p>References:
22983        *
22984        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22985        *     IERS Technical Note No. 32, BKG (2004)
22986        *
22987        *     Explanatory Supplement to the Astronomical Almanac,
22988        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22989        *
22990        *@version 2010 September 10
22991        *
22992        *@since SOFA release 2010-12-01
22993        *
22994        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22995      * @throws JSOFAInternalError an internal error has occured
22996      * @throws JSOFAIllegalParameter unaccaptable date
22997        *
22998        */
22999       public static JulianDate jauUtctai(double utc1, double utc2) throws JSOFAIllegalParameter, JSOFAInternalError
23000 
23001       {
23002           double tai1, tai2;
23003           boolean big1;
23004           double u1, u2,  dats,  datst, ddat, a2, fd;
23005 
23006 
23007           /* Put the two parts of the UTC into big-first order. */
23008           big1 = ( abs(utc1) >= abs(utc2) );
23009           if ( big1 ) {
23010               u1 = utc1;
23011               u2 = utc2;
23012           } else {
23013               u1 = utc2;
23014               u2 = utc1;
23015           }
23016 
23017           /* Get TAI-UTC now. */
23018           Calendar dt = jauJd2cal(u1, u2 );
23019           dats = jauDat(dt.iy, dt.im, dt.id, dt.fd);
23020  //         if ( js < 0 ) return -1;
23021           fd = dt.fd;
23022           /* Get TAI-UTC tomorrow. */
23023           Calendar dtt = jauJd2cal(u1+1.5, u2-fd );
23024           datst = jauDat(dtt.iy, dtt.im, dtt.id, dtt.fd);
23025 //          if ( js < 0 ) return -1;
23026 
23027           /* If today ends in a leap second, scale the fraction into SI days. */
23028           ddat = datst - dats;
23029           if ( abs(ddat) > 0.5 ) fd += fd * ddat / DAYSEC;
23030 
23031           /* Today's calendar date to 2-part JD. */
23032           JulianDate jd = jauCal2jd(dt.iy, dt.im, dt.id ) ;
23033 
23034           /* Assemble the TAI result, preserving the UTC split and order. */
23035           a2 = jd.djm0 - u1;
23036           a2 += jd.djm1;
23037           a2 += fd + dats / DAYSEC;
23038           if ( big1 ) {
23039               tai1 = u1;
23040               tai2 = a2;
23041           } else {
23042               tai1 = a2;
23043               tai2 = u1;
23044           }
23045 
23046           /* FIXME Status. */
23047           return new JulianDate(tai1, tai2);
23048 
23049       };
23050 
23051       /**
23052        *
23053        *  Time scale transformation:  Coordinated Universal Time, UTC, to
23054        *  Universal Time, UT1.
23055        *
23056        * <p>This function is derived from the International Astronomical Union's
23057        *  SOFA (Standards of Fundamental Astronomy) software collection.
23058        *
23059        *<p>Status:  canonical.
23060        *
23061        *<!-- Given: -->
23062        *   @param  utc1  double   UTC as a 2-part quasi Julian Date (Notes 1-4)
23063        *   @param  utc2  double   UTC as a 2-part quasi Julian Date (Notes 1-4)
23064        *   @param  dut1       double   Delta UT1 = UT1-UTC in seconds (Note 5)
23065        *
23066        *<!-- Returned:-->
23067        *     @return UT1 as a 2-part Julian Date (Note 6)
23068        *
23069        *  Returned (function value):
23070        *                int      status: +1 = dubious year (Note 7)
23071        *                                  0 = OK
23072        *                                 -1 = unacceptable date
23073        *
23074        *<p>Notes:
23075        *<ol>
23076        *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
23077        *     convenient way between the two arguments, for example where utc1
23078        *     is the Julian Day Number and utc2 is the fraction of a day.
23079        *
23080        *  <li> JD cannot unambiguously represent UTC during a leap second unless
23081        *     special measures are taken.  The convention in the present
23082        *     function is that the JD day represents UTC days whether the
23083        *     length is 86399, 86400 or 86401 SI seconds.
23084        *
23085        *  <li> The warning status "dubious year" flags UTCs that predate the
23086        *     introduction of the time scale and that are too far in the future
23087        *     to be trusted.  See jauDat  for further details.
23088        *
23089        *  <li> The function jauDtf2d  converts from calendar date and time of
23090        *     day into 2-part Julian Date, and in the case of UTC implements
23091        *     the leap-second-ambiguity convention described above.
23092        *
23093        *  <li> Delta UT1 can be obtained from tabulations provided by the
23094        *     International Earth Rotation and Reference Systems Service.  It
23095        *     It is the caller's responsibility to supply a DUT argument
23096        *     containing the UT1-UTC value that matches the given UTC.
23097        *
23098        *  <li> The returned ut11,ut12 are such that their sum is the UT1 Julian
23099        *     Date.
23100        *
23101        *  <li> The warning status "dubious year" flags UTCs that predate the
23102        *     introduction of the time scale and that are too far in the future
23103        *     to be trusted.  See jauDat for further details.
23104        *</ol>
23105        *<p>References:
23106        *
23107        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
23108        *     IERS Technical Note No. 32, BKG (2004)
23109        *
23110        *     Explanatory Supplement to the Astronomical Almanac,
23111        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
23112        *
23113        *  Called:<ul>
23114        *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
23115        *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
23116        *     <li>{@link #jauUtctai}    UTC to TAI
23117        *     <li>{@link #jauTaiut1}    TAI to UT1
23118        *</ul>
23119        *@version 2010 May 16
23120        *
23121        *@since SOFA release 2010-12-01
23122        *
23123        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
23124      * @throws JSOFAInternalError an internal error has occured
23125      * @throws JSOFAIllegalParameter unaccepatble date
23126        */
23127       public static JulianDate jauUtcut1(double utc1, double utc2, double dut1) throws JSOFAIllegalParameter, JSOFAInternalError
23128       {
23129 
23130     
23131           double dta;
23132           /* Look up TAI-UTC. */
23133           Calendar dt = jauJd2cal(utc1, utc2) ;
23134           double dat = jauDat ( dt.iy, dt.im, dt.id, 0.0 );
23135      
23136 
23137           /* Form UT1-TAI. */
23138           dta = dut1 - dat;
23139 
23140           /* UTC to TAI to UT1. */
23141           JulianDate tai = jauUtctai(utc1, utc2);
23142           return jauTaiut1(tai.djm0, tai.djm1, dta) ;
23143 
23144       };
23145 
23146       
23147     public static CelestialIntermediatePole jauXy06(double date1, double date2)
23148     /**
23149     *  X,Y coordinates of celestial intermediate pole from series based
23150     *  on IAU 2006 precession and IAU 2000A nutation.
23151     *
23152     *<p>This function is derived from the International Astronomical Union's
23153     *  SOFA (Standards Of Fundamental Astronomy) software collection.
23154     *
23155     *<p>Status:  canonical model.
23156     *
23157     *<!-- Given: -->
23158     *     @param date1 double TT as a 2-part Julian Date (Note 1)
23159     *     @param date2 double TT as a 2-part Julian Date (Note 1)
23160     *
23161     *<!-- Returned: -->
23162     *     @return  CIP X,Y coordinates (Note 2)
23163     *
23164     * <p>Notes:
23165     * <ol>
23166     *
23167     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
23168     *     convenient way between the two arguments.  For example,
23169     *     JD(TT)=2450123.7 could be expressed in any of these ways,
23170     *     among others:
23171     *<pre>
23172     *            date1          date2
23173     *
23174     *         2450123.7           0.0       (JD method)
23175     *         2451545.0       -1421.3       (J2000 method)
23176     *         2400000.5       50123.2       (MJD method)
23177     *         2450123.5           0.2       (date &amp; time method)
23178     *</pre>
23179     *     The JD method is the most natural and convenient to use in
23180     *     cases where the loss of several decimal digits of resolution
23181     *     is acceptable.  The J2000 method is best matched to the way
23182     *     the argument is handled internally and will deliver the
23183     *     optimum resolution.  The MJD method and the date &amp; time methods
23184     *     are both good compromises between resolution and convenience.
23185     *
23186     * <li> The X,Y coordinates are those of the unit vector towards the
23187     *     celestial intermediate pole.  They represent the combined effects
23188     *     of frame bias, precession and nutation.
23189     *
23190     * <li> The fundamental arguments used are as adopted in IERS Conventions
23191     *     (2003) and are from Simon et al. (1994) and Souchay et al.
23192     *     (1999).
23193     *
23194     * <li> This is an alternative to the angles-based method, via the JSOFA
23195     *     function jauFw2xy and as used in jauXys06a for example.  The two
23196     *     methods agree at the 1 microarcsecond level (at present), a
23197     *     negligible amount compared with the intrinsic accuracy of the
23198     *     models.  However, it would be unwise to mix the two methods
23199     *     (angles-based and series-based) in a single application.
23200     *</ol>
23201     *<p>Called:<ul>
23202     *     <li>{@link #jauFal03} mean anomaly of the Moon
23203     *     <li>{@link #jauFalp03} mean anomaly of the Sun
23204     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
23205     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
23206     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
23207     *     <li>{@link #jauFame03} mean longitude of Mercury
23208     *     <li>{@link #jauFave03} mean longitude of Venus
23209     *     <li>{@link #jauFae03} mean longitude of Earth
23210     *     <li>{@link #jauFama03} mean longitude of Mars
23211     *     <li>{@link #jauFaju03} mean longitude of Jupiter
23212     *     <li>{@link #jauFasa03} mean longitude of Saturn
23213     *     <li>{@link #jauFaur03} mean longitude of Uranus
23214     *     <li>{@link #jauFane03} mean longitude of Neptune
23215     *     <li>{@link #jauFapa03} general accumulated precession in longitude
23216     * </ul>
23217     *<p>References:
23218     *
23219     *    <p>Capitaine, N., Wallace, P.T. &amp; Chapront, J., 2003,
23220     *     Astron.Astrophys., 412, 567
23221     *
23222     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
23223     *
23224     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
23225     *     IERS Technical Note No. 32, BKG
23226     *
23227     *     Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
23228     *     Francou, G. &amp; Laskar, J., Astron.Astrophys., 1994, 282, 663
23229     *
23230     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M., 1999,
23231     *     Astron.Astrophys.Supp.Ser. 135, 111
23232     *
23233     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
23234     *
23235     *@version 2009 October 16
23236     *
23237     *  @since Release 20101201
23238     *
23239     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
23240     */
23241     {
23242 
23243     /* Maximum power of T in the polynomials for X and Y */
23244        final int MAXPT = (5);
23245 
23246     /* Polynomial coefficients (arcsec, X then Y). */
23247        final double xyp[][] = {
23248 
23249           {    -0.016617,
23250              2004.191898,
23251                -0.4297829,
23252                -0.19861834,
23253                 0.000007578,
23254                 0.0000059285
23255           },
23256           {    -0.006951,
23257                -0.025896,
23258               -22.4072747,
23259                 0.00190059,
23260                 0.001112526,
23261                 0.0000001358
23262           }
23263        };
23264 
23265     /* N.B mfals defined as class static (outside this method) to avoid problems with 65535 byte limit for methods */ 
23266     /* Number of frequencies:  luni-solar */
23267         final int NFLS = mfals.length;
23268 
23269     /* Number of frequencies:  planetary */
23270        final int NFPL =mfapl.length ;
23271 
23272     /* Pointers into amplitudes array, one pointer per frequency */
23273        final int nc[] = {
23274 
23275        /* 1-100 */
23276            1,    21,    37,    51,    65,    79,    91,   103,   115,   127,
23277          139,   151,   163,   172,   184,   196,   207,   219,   231,   240,
23278          252,   261,   273,   285,   297,   309,   318,   327,   339,   351,
23279          363,   372,   384,   396,   405,   415,   423,   435,   444,   452,
23280          460,   467,   474,   482,   490,   498,   506,   513,   521,   528,
23281          536,   543,   551,   559,   566,   574,   582,   590,   597,   605,
23282          613,   620,   628,   636,   644,   651,   658,   666,   674,   680,
23283          687,   695,   702,   710,   717,   725,   732,   739,   746,   753,
23284          760,   767,   774,   782,   790,   798,   805,   812,   819,   826,
23285          833,   840,   846,   853,   860,   867,   874,   881,   888,   895,
23286 
23287        /* 101-200 */
23288          901,   908,   914,   921,   928,   934,   941,   948,   955,   962,
23289          969,   976,   982,   989,   996,  1003,  1010,  1017,  1024,  1031,
23290         1037,  1043,  1050,  1057,  1064,  1071,  1078,  1084,  1091,  1098,
23291         1104,  1112,  1118,  1124,  1131,  1138,  1145,  1151,  1157,  1164,
23292         1171,  1178,  1185,  1192,  1199,  1205,  1212,  1218,  1226,  1232,
23293         1239,  1245,  1252,  1259,  1266,  1272,  1278,  1284,  1292,  1298,
23294         1304,  1310,  1316,  1323,  1329,  1335,  1341,  1347,  1353,  1359,
23295         1365,  1371,  1377,  1383,  1389,  1396,  1402,  1408,  1414,  1420,
23296         1426,  1434,  1440,  1446,  1452,  1459,  1465,  1471,  1477,  1482,
23297         1488,  1493,  1499,  1504,  1509,  1514,  1520,  1527,  1532,  1538,
23298 
23299        /* 201-300 */
23300         1543,  1548,  1553,  1558,  1564,  1569,  1574,  1579,  1584,  1589,
23301         1594,  1596,  1598,  1600,  1602,  1605,  1608,  1610,  1612,  1617,
23302         1619,  1623,  1625,  1627,  1629,  1632,  1634,  1640,  1642,  1644,
23303         1646,  1648,  1650,  1652,  1654,  1658,  1660,  1662,  1664,  1668,
23304         1670,  1672,  1673,  1675,  1679,  1681,  1683,  1684,  1686,  1688,
23305         1690,  1693,  1695,  1697,  1701,  1703,  1705,  1707,  1709,  1711,
23306         1712,  1715,  1717,  1721,  1723,  1725,  1727,  1729,  1731,  1733,
23307         1735,  1737,  1739,  1741,  1743,  1745,  1747,  1749,  1751,  1753,
23308         1755,  1757,  1759,  1761,  1762,  1764,  1766,  1768,  1769,  1771,
23309         1773,  1775,  1777,  1779,  1781,  1783,  1785,  1787,  1788,  1790,
23310 
23311        /* 301-400 */
23312         1792,  1794,  1796,  1798,  1800,  1802,  1804,  1806,  1807,  1809,
23313         1811,  1815,  1817,  1819,  1821,  1823,  1825,  1827,  1829,  1831,
23314         1833,  1835,  1837,  1839,  1840,  1842,  1844,  1848,  1850,  1852,
23315         1854,  1856,  1858,  1859,  1860,  1862,  1864,  1866,  1868,  1869,
23316         1871,  1873,  1875,  1877,  1879,  1881,  1883,  1885,  1887,  1889,
23317         1891,  1892,  1896,  1898,  1900,  1901,  1903,  1905,  1907,  1909,
23318         1910,  1911,  1913,  1915,  1919,  1921,  1923,  1927,  1929,  1931,
23319         1933,  1935,  1937,  1939,  1943,  1945,  1947,  1948,  1949,  1951,
23320         1953,  1955,  1957,  1958,  1960,  1962,  1964,  1966,  1968,  1970,
23321         1971,  1973,  1974,  1975,  1977,  1979,  1980,  1981,  1982,  1984,
23322 
23323        /* 401-500 */
23324         1986,  1988,  1990,  1992,  1994,  1995,  1997,  1999,  2001,  2003,
23325         2005,  2007,  2008,  2009,  2011,  2013,  2015,  2017,  2019,  2021,
23326         2023,  2024,  2025,  2027,  2029,  2031,  2033,  2035,  2037,  2041,
23327         2043,  2045,  2046,  2047,  2049,  2051,  2053,  2055,  2056,  2057,
23328         2059,  2061,  2063,  2065,  2067,  2069,  2070,  2071,  2072,  2074,
23329         2076,  2078,  2080,  2082,  2084,  2086,  2088,  2090,  2092,  2094,
23330         2095,  2096,  2097,  2099,  2101,  2105,  2106,  2107,  2108,  2109,
23331         2110,  2111,  2113,  2115,  2119,  2121,  2123,  2125,  2127,  2129,
23332         2131,  2133,  2135,  2136,  2137,  2139,  2141,  2143,  2145,  2147,
23333         2149,  2151,  2153,  2155,  2157,  2159,  2161,  2163,  2165,  2167,
23334 
23335        /* 501-600 */
23336         2169,  2171,  2173,  2175,  2177,  2179,  2181,  2183,  2185,  2186,
23337         2187,  2188,  2192,  2193,  2195,  2197,  2199,  2201,  2203,  2205,
23338         2207,  2209,  2211,  2213,  2217,  2219,  2221,  2223,  2225,  2227,
23339         2229,  2231,  2233,  2234,  2235,  2236,  2237,  2238,  2239,  2240,
23340         2241,  2244,  2246,  2248,  2250,  2252,  2254,  2256,  2258,  2260,
23341         2262,  2264,  2266,  2268,  2270,  2272,  2274,  2276,  2278,  2280,
23342         2282,  2284,  2286,  2288,  2290,  2292,  2294,  2296,  2298,  2300,
23343         2302,  2303,  2304,  2305,  2306,  2307,  2309,  2311,  2313,  2315,
23344         2317,  2319,  2321,  2323,  2325,  2327,  2329,  2331,  2333,  2335,
23345         2337,  2341,  2343,  2345,  2347,  2349,  2351,  2352,  2355,  2356,
23346 
23347        /* 601-700 */
23348         2357,  2358,  2359,  2361,  2363,  2364,  2365,  2366,  2367,  2368,
23349         2369,  2370,  2371,  2372,  2373,  2374,  2376,  2378,  2380,  2382,
23350         2384,  2385,  2386,  2387,  2388,  2389,  2390,  2391,  2392,  2393,
23351         2394,  2395,  2396,  2397,  2398,  2399,  2400,  2401,  2402,  2403,
23352         2404,  2405,  2406,  2407,  2408,  2409,  2410,  2411,  2412,  2413,
23353         2414,  2415,  2417,  2418,  2430,  2438,  2445,  2453,  2460,  2468,
23354         2474,  2480,  2488,  2496,  2504,  2512,  2520,  2527,  2535,  2543,
23355         2550,  2558,  2566,  2574,  2580,  2588,  2596,  2604,  2612,  2619,
23356         2627,  2634,  2642,  2648,  2656,  2664,  2671,  2679,  2685,  2693,
23357         2701,  2709,  2717,  2725,  2733,  2739,  2747,  2753,  2761,  2769,
23358 
23359        /* 701-800 */
23360         2777,  2785,  2793,  2801,  2809,  2817,  2825,  2833,  2841,  2848,
23361         2856,  2864,  2872,  2878,  2884,  2892,  2898,  2906,  2914,  2922,
23362         2930,  2938,  2944,  2952,  2958,  2966,  2974,  2982,  2988,  2996,
23363         3001,  3009,  3017,  3025,  3032,  3039,  3045,  3052,  3059,  3067,
23364         3069,  3076,  3083,  3090,  3098,  3105,  3109,  3111,  3113,  3120,
23365         3124,  3128,  3132,  3136,  3140,  3144,  3146,  3150,  3158,  3161,
23366         3165,  3166,  3168,  3172,  3176,  3180,  3182,  3185,  3189,  3193,
23367         3194,  3197,  3200,  3204,  3208,  3212,  3216,  3219,  3221,  3222,
23368         3226,  3230,  3234,  3238,  3242,  3243,  3247,  3251,  3254,  3258,
23369         3262,  3266,  3270,  3274,  3275,  3279,  3283,  3287,  3289,  3293,
23370 
23371        /* 801-900 */
23372         3296,  3300,  3303,  3307,  3311,  3315,  3319,  3321,  3324,  3327,
23373         3330,  3334,  3338,  3340,  3342,  3346,  3350,  3354,  3358,  3361,
23374         3365,  3369,  3373,  3377,  3381,  3385,  3389,  3393,  3394,  3398,
23375         3402,  3406,  3410,  3413,  3417,  3421,  3425,  3429,  3433,  3435,
23376         3439,  3443,  3446,  3450,  3453,  3457,  3458,  3461,  3464,  3468,
23377         3472,  3476,  3478,  3481,  3485,  3489,  3493,  3497,  3501,  3505,
23378         3507,  3511,  3514,  3517,  3521,  3524,  3525,  3527,  3529,  3533,
23379         3536,  3540,  3541,  3545,  3548,  3551,  3555,  3559,  3563,  3567,
23380         3569,  3570,  3574,  3576,  3578,  3582,  3586,  3590,  3593,  3596,
23381         3600,  3604,  3608,  3612,  3616,  3620,  3623,  3626,  3630,  3632,
23382 
23383        /* 901-1000 */
23384         3636,  3640,  3643,  3646,  3648,  3652,  3656,  3660,  3664,  3667,
23385         3669,  3671,  3675,  3679,  3683,  3687,  3689,  3693,  3694,  3695,
23386         3699,  3703,  3705,  3707,  3710,  3713,  3717,  3721,  3725,  3729,
23387         3733,  3736,  3740,  3744,  3748,  3752,  3754,  3757,  3759,  3763,
23388         3767,  3770,  3773,  3777,  3779,  3783,  3786,  3790,  3794,  3798,
23389         3801,  3805,  3809,  3813,  3817,  3821,  3825,  3827,  3831,  3835,
23390         3836,  3837,  3840,  3844,  3848,  3852,  3856,  3859,  3863,  3867,
23391         3869,  3871,  3875,  3879,  3883,  3887,  3890,  3894,  3898,  3901,
23392         3905,  3909,  3913,  3917,  3921,  3922,  3923,  3924,  3926,  3930,
23393         3932,  3936,  3938,  3940,  3944,  3948,  3952,  3956,  3959,  3963,
23394 
23395        /* 1001-1100 */
23396         3965,  3969,  3973,  3977,  3979,  3981,  3982,  3986,  3989,  3993,
23397         3997,  4001,  4004,  4006,  4009,  4012,  4016,  4020,  4024,  4026,
23398         4028,  4032,  4036,  4040,  4044,  4046,  4050,  4054,  4058,  4060,
23399         4062,  4063,  4064,  4068,  4071,  4075,  4077,  4081,  4083,  4087,
23400         4089,  4091,  4095,  4099,  4101,  4103,  4105,  4107,  4111,  4115,
23401         4119,  4123,  4127,  4129,  4131,  4135,  4139,  4141,  4143,  4145,
23402         4149,  4153,  4157,  4161,  4165,  4169,  4173,  4177,  4180,  4183,
23403         4187,  4191,  4195,  4198,  4201,  4205,  4209,  4212,  4213,  4216,
23404         4217,  4221,  4223,  4226,  4230,  4234,  4236,  4240,  4244,  4248,
23405         4252,  4256,  4258,  4262,  4264,  4266,  4268,  4270,  4272,  4276,
23406 
23407        /* 1101-1200 */
23408         4279,  4283,  4285,  4287,  4289,  4293,  4295,  4299,  4300,  4301,
23409         4305,  4309,  4313,  4317,  4319,  4323,  4325,  4329,  4331,  4333,
23410         4335,  4337,  4341,  4345,  4349,  4351,  4353,  4357,  4361,  4365,
23411         4367,  4369,  4373,  4377,  4381,  4383,  4387,  4389,  4391,  4395,
23412         4399,  4403,  4407,  4411,  4413,  4414,  4415,  4418,  4419,  4421,
23413         4423,  4427,  4429,  4431,  4433,  4435,  4437,  4439,  4443,  4446,
23414         4450,  4452,  4456,  4458,  4460,  4462,  4466,  4469,  4473,  4477,
23415         4481,  4483,  4487,  4489,  4491,  4493,  4497,  4499,  4501,  4504,
23416         4506,  4510,  4513,  4514,  4515,  4518,  4521,  4522,  4525,  4526,
23417         4527,  4530,  4533,  4534,  4537,  4541,  4542,  4543,  4544,  4545,
23418 
23419        /* 1201-1300 */
23420         4546,  4547,  4550,  4553,  4554,  4555,  4558,  4561,  4564,  4567,
23421         4568,  4571,  4574,  4575,  4578,  4581,  4582,  4585,  4586,  4588,
23422         4590,  4592,  4596,  4598,  4602,  4604,  4608,  4612,  4613,  4616,
23423         4619,  4622,  4623,  4624,  4625,  4626,  4629,  4632,  4633,  4636,
23424         4639,  4640,  4641,  4642,  4643,  4644,  4645,  4648,  4649,  4650,
23425         4651,  4652,  4653,  4656,  4657,  4660,  4661,  4664,  4667,  4670,
23426         4671,  4674,  4675,  4676,  4677,  4678,  4681,  4682,  4683,  4684,
23427         4687,  4688,  4689,  4692,  4693,  4696,  4697,  4700,  4701,  4702,
23428         4703,  4704,  4707,  4708,  4711,  4712,  4715,  4716,  4717,  4718,
23429         4719,  4720,  4721,  4722,  4723,  4726,  4729,  4730,  4733,  4736,
23430 
23431        /* 1301-(NFLS+NFPL) */
23432         4737,  4740,  4741,  4742,  4745,  4746,  4749,  4752,  4753
23433        };
23434 
23435     /* Amplitude coefficients (microarcsec);  indexed using the nc array. */
23436        final double a[] = {
23437 
23438        /* 1-105 */
23439              -6844318.44,     9205236.26,1328.67,1538.18,      205833.11,
23440                153041.79,       -3309.73, 853.32,2037.98,       -2301.27,
23441            81.46, 120.56, -20.39, -15.22,   1.73,  -1.61,  -0.10,   0.11,
23442            -0.02,  -0.02,     -523908.04,      573033.42,-544.75,-458.66,
23443                 12814.01,       11714.49, 198.97,-290.91, 155.74,-143.27,
23444            -2.75,  -1.03,  -1.27,  -1.16,   0.00,  -0.01,      -90552.22,
23445                 97846.69, 111.23, 137.41,2187.91,2024.68,  41.44, -51.26,
23446            26.92, -24.46,  -0.46,  -0.28,  -0.22,  -0.20,       82168.76,
23447                -89618.24, -27.64, -29.05,       -2004.36,       -1837.32,
23448           -36.07,  48.00, -24.43,  22.41,   0.47,   0.24,   0.20,   0.18,
23449                 58707.02,7387.02, 470.05,-192.40, 164.33,       -1312.21,
23450          -179.73, -28.93, -17.36,  -1.83,  -0.50,   3.57,   0.00,   0.13,
23451                -20557.78,       22438.42, -20.84, -17.40, 501.82, 459.68,
23452            59.20, -67.30,   6.08,  -5.61,  -1.36,  -1.19,       28288.28,
23453          -674.99, -34.69,  35.80, -15.07,-632.54, -11.19,   0.78,  -8.41,
23454             0.17,   0.01,   0.07,      -15406.85,       20069.50,  15.12,
23455 
23456        /* 106-219 */
23457            31.80, 448.76, 344.50,  -5.77,   1.41,   4.59,  -5.02,   0.17,
23458             0.24,      -11991.74,       12902.66,  32.46,  36.70, 288.49,
23459           268.14,   5.70,  -7.06,   3.57,  -3.23,  -0.06,  -0.04,
23460                 -8584.95,       -9592.72,   4.42, -13.20,-214.50, 192.06,
23461            23.87,  29.83,   2.54,   2.40,   0.60,  -0.48,5095.50,
23462                 -6918.22,   7.19,   3.92,-154.91,-113.94,   2.86,  -1.04,
23463            -1.52,   1.73,  -0.07,  -0.10,       -4910.93,       -5331.13,
23464             0.76,   0.40,-119.21, 109.81,   2.16,   3.20,   1.46,   1.33,
23465             0.04,  -0.02,       -6245.02,-123.48,  -6.68,  -8.20,  -2.76,
23466           139.64,   2.71,   0.15,   1.86,2511.85,       -3323.89,   1.07,
23467            -0.90, -74.33, -56.17,   1.16,  -0.01,  -0.75,   0.83,  -0.02,
23468            -0.04,2307.58,3143.98,  -7.52,   7.50,  70.31, -51.60,   1.46,
23469             0.16,  -0.69,  -0.79,   0.02,  -0.05,2372.58,2554.51,   5.93,
23470            -6.60,  57.12, -53.05,  -0.96,  -1.24,  -0.71,  -0.64,  -0.01,
23471                 -2053.16,2636.13,   5.13,   7.80,  58.94,  45.91,  -0.42,
23472            -0.12,   0.61,  -0.66,   0.02,   0.03,       -1825.49,
23473 
23474        /* 220-339 */
23475                 -2423.59,   1.23,  -2.00, -54.19,  40.82,  -1.07,  -1.02,
23476             0.54,   0.61,  -0.04,   0.04,2521.07,-122.28,  -5.97,   2.90,
23477            -2.73, -56.37,  -0.82,   0.13,  -0.75,       -1534.09,1645.01,
23478             6.29,   6.80,  36.78,  34.30,   0.92,  -1.25,   0.46,  -0.41,
23479            -0.02,  -0.01,1898.27,  47.70,  -0.72,   2.50,   1.07, -42.45,
23480            -0.94,   0.02,  -0.56,       -1292.02,       -1387.00,   0.00,
23481             0.00, -31.01,  28.89,   0.68,   0.00,   0.38,   0.35,  -0.01,
23482            -0.01,       -1234.96,1323.81,   5.21,   5.90,  29.60,  27.61,
23483             0.74,  -1.22,   0.37,  -0.33,  -0.02,  -0.01,1137.48,
23484                 -1233.89,  -0.04,  -0.30, -27.59, -25.43,  -0.61,   1.00,
23485            -0.34,   0.31,   0.01,   0.01,-813.13,       -1075.60,   0.40,
23486             0.30, -24.05,  18.18,  -0.40,  -0.01,   0.24,   0.27,  -0.01,
23487             0.01,1163.22, -60.90,  -2.94,   1.30,  -1.36, -26.01,  -0.58,
23488             0.07,  -0.35,1029.70, -55.55,  -2.63,   1.10,  -1.25, -23.02,
23489            -0.52,   0.06,  -0.31,-556.26, 852.85,   3.16,  -4.48,  19.06,
23490            12.44,  -0.81,  -0.27,   0.17,  -0.21,   0.00,   0.02,-603.52,
23491 
23492        /* 340-467 */
23493          -800.34,   0.44,   0.10, -17.90,  13.49,  -0.08,  -0.01,   0.18,
23494             0.20,  -0.01,   0.01,-628.24, 684.99,  -0.64,  -0.50,  15.32,
23495            14.05,   3.18,  -4.19,   0.19,  -0.17,  -0.09,  -0.07,-866.48,
23496           -16.26,   0.52,  -1.30,  -0.36,  19.37,   0.43,  -0.01,   0.26,
23497          -512.37, 695.54,  -1.47,  -1.40,  15.55,  11.46,  -0.16,   0.03,
23498             0.15,  -0.17,   0.01,   0.01, 506.65, 643.75,   2.54,  -2.62,
23499            14.40, -11.33,  -0.77,  -0.06,  -0.15,  -0.16,   0.00,   0.01,
23500           664.57,  16.81,  -0.40,   1.00,   0.38, -14.86,  -3.71,  -0.09,
23501            -0.20, 405.91, 522.11,   0.99,  -1.50,  11.67,  -9.08,  -0.25,
23502            -0.02,  -0.12,  -0.13,-305.78, 326.60,   1.75,   1.90,   7.30,
23503             6.84,   0.20,  -0.04, 300.99,-325.03,  -0.44,  -0.50,  -7.27,
23504            -6.73,  -1.01,   0.01,   0.00,   0.08,   0.00,   0.02, 438.51,
23505            10.47,  -0.56,  -0.20,   0.24,  -9.81,  -0.24,   0.01,  -0.13,
23506          -264.02, 335.24,   0.99,   1.40,   7.49,   5.90,  -0.27,  -0.02,
23507           284.09, 307.03,   0.32,  -0.40,   6.87,  -6.35,  -0.99,  -0.01,
23508          -250.54, 327.11,   0.08,   0.40,   7.31,   5.60,  -0.30, 230.72,
23509 
23510        /* 468-595 */
23511          -304.46,   0.08,  -0.10,  -6.81,  -5.16,   0.27, 229.78, 304.17,
23512            -0.60,   0.50,   6.80,  -5.14,   0.33,   0.01, 256.30,-276.81,
23513            -0.28,  -0.40,  -6.19,  -5.73,  -0.14,   0.01,-212.82, 269.45,
23514             0.84,   1.20,   6.02,   4.76,   0.14,  -0.02, 196.64, 272.05,
23515            -0.84,   0.90,   6.08,  -4.40,   0.35,   0.02, 188.95, 272.22,
23516            -0.12,   0.30,   6.09,  -4.22,   0.34,-292.37,  -5.10,  -0.32,
23517            -0.40,  -0.11,   6.54,   0.14,   0.01, 161.79,-220.67,   0.24,
23518             0.10,  -4.93,  -3.62,  -0.08, 261.54, -19.94,  -0.95,   0.20,
23519            -0.45,  -5.85,  -0.13,   0.02, 142.16,-190.79,   0.20,   0.10,
23520            -4.27,  -3.18,  -0.07, 187.95,  -4.11,  -0.24,   0.30,  -0.09,
23521            -4.20,  -0.09,   0.01,   0.00,   0.00, -79.08, 167.90,   0.04,
23522             0.00,   3.75,   1.77, 121.98, 131.04,  -0.08,   0.10,   2.93,
23523            -2.73,  -0.06,-172.95,  -8.11,  -0.40,  -0.20,  -0.18,   3.87,
23524             0.09,   0.01,-160.15, -55.30, -14.04,  13.90,  -1.23,   3.58,
23525             0.40,   0.31,-115.40, 123.20,   0.60,   0.70,   2.75,   2.58,
23526             0.08,  -0.01,-168.26,  -2.00,   0.20,  -0.20,  -0.04,   3.76,
23527 
23528        /* 596-723 */
23529             0.08,-114.49, 123.20,   0.32,   0.40,   2.75,   2.56,   0.07,
23530            -0.01, 112.14, 120.70,   0.28,  -0.30,   2.70,  -2.51,  -0.07,
23531            -0.01, 161.34,   4.03,   0.20,   0.20,   0.09,  -3.61,  -0.08,
23532            91.31, 126.64,  -0.40,   0.40,   2.83,  -2.04,  -0.04,   0.01,
23533           105.29, 112.90,   0.44,  -0.50,   2.52,  -2.35,  -0.07,  -0.01,
23534            98.69,-106.20,  -0.28,  -0.30,  -2.37,  -2.21,  -0.06,   0.01,
23535            86.74,-112.94,  -0.08,  -0.20,  -2.53,  -1.94,  -0.05,-134.81,
23536             3.51,   0.20,  -0.20,   0.08,   3.01,   0.07,  79.03, 107.31,
23537            -0.24,   0.20,   2.40,  -1.77,  -0.04,   0.01, 132.81, -10.77,
23538            -0.52,   0.10,  -0.24,  -2.97,  -0.07,   0.01,-130.31,  -0.90,
23539             0.04,   0.00,   0.00,   2.91, -78.56,  85.32,   0.00,   0.00,
23540             1.91,   1.76,   0.04,   0.00,   0.00, -41.53,  89.10,   0.02,
23541             0.00,   1.99,   0.93,  66.03, -71.00,  -0.20,  -0.20,  -1.59,
23542            -1.48,  -0.04,  60.50,  64.70,   0.36,  -0.40,   1.45,  -1.35,
23543            -0.04,  -0.01, -52.27, -70.01,   0.00,   0.00,  -1.57,   1.17,
23544             0.03, -52.95,  66.29,   0.32,   0.40,   1.48,   1.18,   0.04,
23545 
23546        /* 724-851 */
23547            -0.01,  51.02,  67.25,   0.00,   0.00,   1.50,  -1.14,  -0.03,
23548           -55.66, -60.92,   0.16,  -0.20,  -1.36,   1.24,   0.03, -54.81,
23549           -59.20,  -0.08,   0.20,  -1.32,   1.23,   0.03,  51.32, -55.60,
23550             0.00,   0.00,  -1.24,  -1.15,  -0.03,  48.29,  51.80,   0.20,
23551            -0.20,   1.16,  -1.08,  -0.03, -45.59, -49.00,  -0.12,   0.10,
23552            -1.10,   1.02,   0.03,  40.54, -52.69,  -0.04,  -0.10,  -1.18,
23553            -0.91,  -0.02, -40.58, -49.51,  -1.00,   1.00,  -1.11,   0.91,
23554             0.04,   0.02, -43.76,  46.50,   0.36,   0.40,   1.04,   0.98,
23555             0.03,  -0.01,  62.65,  -5.00,  -0.24,   0.00,  -0.11,  -1.40,
23556            -0.03,   0.01, -38.57,  49.59,   0.08,   0.10,   1.11,   0.86,
23557             0.02, -33.22, -44.04,   0.08,  -0.10,  -0.98,   0.74,   0.02,
23558            37.15, -39.90,  -0.12,  -0.10,  -0.89,  -0.83,  -0.02,  36.68,
23559           -39.50,  -0.04,  -0.10,  -0.88,  -0.82,  -0.02, -53.22,  -3.91,
23560            -0.20,   0.00,  -0.09,   1.19,   0.03,  32.43, -42.19,  -0.04,
23561            -0.10,  -0.94,  -0.73,  -0.02, -51.00,  -2.30,  -0.12,  -0.10,
23562             0.00,   1.14, -29.53, -39.11,   0.04,   0.00,  -0.87,   0.66,
23563 
23564        /* 852-979 */
23565             0.02,  28.50, -38.92,  -0.08,  -0.10,  -0.87,  -0.64,  -0.02,
23566            26.54,  36.95,  -0.12,   0.10,   0.83,  -0.59,  -0.01,  26.54,
23567            34.59,   0.04,  -0.10,   0.77,  -0.59,  -0.02,  28.35, -32.55,
23568            -0.16,   0.20,  -0.73,  -0.63,  -0.01, -28.00,  30.40,   0.00,
23569             0.00,   0.68,   0.63,   0.01, -27.61,  29.40,   0.20,   0.20,
23570             0.66,   0.62,   0.02,  40.33,   0.40,  -0.04,   0.10,   0.00,
23571            -0.90, -23.28,  31.61,  -0.08,  -0.10,   0.71,   0.52,   0.01,
23572            37.75,   0.80,   0.04,   0.10,   0.00,  -0.84,  23.66,  25.80,
23573             0.00,   0.00,   0.58,  -0.53,  -0.01,  21.01, -27.91,   0.00,
23574             0.00,  -0.62,  -0.47,  -0.01, -34.81,   2.89,   0.04,   0.00,
23575             0.00,   0.78, -23.49, -25.31,   0.00,   0.00,  -0.57,   0.53,
23576             0.01, -23.47,  25.20,   0.16,   0.20,   0.56,   0.52,   0.02,
23577            19.58,  27.50,  -0.12,   0.10,   0.62,  -0.44,  -0.01, -22.67,
23578           -24.40,  -0.08,   0.10,  -0.55,   0.51,   0.01, -19.97,  25.00,
23579             0.12,   0.20,   0.56,   0.45,   0.01,  21.28, -22.80,  -0.08,
23580            -0.10,  -0.51,  -0.48,  -0.01, -30.47,   0.91,   0.04,   0.00,
23581 
23582        /* 980-1107 */
23583             0.00,   0.68,  18.58,  24.00,   0.04,  -0.10,   0.54,  -0.42,
23584            -0.01, -18.02,  24.40,  -0.04,  -0.10,   0.55,   0.40,   0.01,
23585            17.74,  22.50,   0.08,  -0.10,   0.50,  -0.40,  -0.01, -19.41,
23586            20.70,   0.08,   0.10,   0.46,   0.43,   0.01, -18.64,  20.11,
23587             0.00,   0.00,   0.45,   0.42,   0.01, -16.75,  21.60,   0.04,
23588             0.10,   0.48,   0.37,   0.01, -18.42, -20.00,   0.00,   0.00,
23589            -0.45,   0.41,   0.01, -26.77,   1.41,   0.08,   0.00,   0.00,
23590             0.60, -26.17,  -0.19,   0.00,   0.00,   0.00,   0.59, -15.52,
23591            20.51,   0.00,   0.00,   0.46,   0.35,   0.01, -25.42,  -1.91,
23592            -0.08,   0.00,  -0.04,   0.57,   0.45, -17.42,  18.10,   0.00,
23593             0.00,   0.40,   0.39,   0.01,  16.39, -17.60,  -0.08,  -0.10,
23594            -0.39,  -0.37,  -0.01, -14.37,  18.91,   0.00,   0.00,   0.42,
23595             0.32,   0.01,  23.39,  -2.40,  -0.12,   0.00,   0.00,  -0.52,
23596            14.32, -18.50,  -0.04,  -0.10,  -0.41,  -0.32,  -0.01,  15.69,
23597            17.08,   0.00,   0.00,   0.38,  -0.35,  -0.01, -22.99,   0.50,
23598             0.04,   0.00,   0.00,   0.51,   0.00,   0.00,  14.47, -17.60,
23599 
23600        /* 1108-1235 */
23601            -0.01,   0.00,  -0.39,  -0.32, -13.33,  18.40,  -0.04,  -0.10,
23602             0.41,   0.30,  22.47,  -0.60,  -0.04,   0.00,   0.00,  -0.50,
23603           -12.78, -17.41,   0.04,   0.00,  -0.39,   0.29,   0.01, -14.10,
23604           -15.31,   0.04,   0.00,  -0.34,   0.32,   0.01,  11.98,  16.21,
23605            -0.04,   0.00,   0.36,  -0.27,  -0.01,  19.65,  -1.90,  -0.08,
23606             0.00,   0.00,  -0.44,  19.61,  -1.50,  -0.08,   0.00,   0.00,
23607            -0.44,  13.41, -14.30,  -0.04,  -0.10,  -0.32,  -0.30,  -0.01,
23608           -13.29,  14.40,   0.00,   0.00,   0.32,   0.30,   0.01,  11.14,
23609           -14.40,  -0.04,   0.00,  -0.32,  -0.25,  -0.01,  12.24, -13.38,
23610             0.04,   0.00,  -0.30,  -0.27,  -0.01,  10.07, -13.81,   0.04,
23611             0.00,  -0.31,  -0.23,  -0.01,  10.46,  13.10,   0.08,  -0.10,
23612             0.29,  -0.23,  -0.01,  16.55,  -1.71,  -0.08,   0.00,   0.00,
23613            -0.37,   9.75, -12.80,   0.00,   0.00,  -0.29,  -0.22,  -0.01,
23614             9.11,  12.80,   0.00,   0.00,   0.29,  -0.20,   0.00,   0.00,
23615            -6.44, -13.80,   0.00,   0.00,  -0.31,   0.14,  -9.19, -12.00,
23616             0.00,   0.00,  -0.27,   0.21, -10.30,  10.90,   0.08,   0.10,
23617 
23618        /* 1236-1363 */
23619             0.24,   0.23,   0.01,  14.92,  -0.80,  -0.04,   0.00,   0.00,
23620            -0.33,  10.02, -10.80,   0.00,   0.00,  -0.24,  -0.22,  -0.01,
23621            -9.75,  10.40,   0.04,   0.00,   0.23,   0.22,   0.01,   9.67,
23622           -10.40,  -0.04,   0.00,  -0.23,  -0.22,  -0.01,  -8.28, -11.20,
23623             0.04,   0.00,  -0.25,   0.19,  13.32,  -1.41,  -0.08,   0.00,
23624             0.00,  -0.30,   8.27,  10.50,   0.04,   0.00,   0.23,  -0.19,
23625             0.00,   0.00,  13.13,   0.00,   0.00,   0.00,   0.00,  -0.29,
23626           -12.93,   0.70,   0.04,   0.00,   0.00,   0.29,   7.91, -10.20,
23627             0.00,   0.00,  -0.23,  -0.18,  -7.84, -10.00,  -0.04,   0.00,
23628            -0.22,   0.18,   7.44,   9.60,   0.00,   0.00,   0.21,  -0.17,
23629            -7.64,   9.40,   0.08,   0.10,   0.21,   0.17,   0.01, -11.38,
23630             0.60,   0.04,   0.00,   0.00,   0.25,  -7.48,   8.30,   0.00,
23631             0.00,   0.19,   0.17, -10.98,  -0.20,   0.00,   0.00,   0.00,
23632             0.25,  10.98,   0.20,   0.00,   0.00,   0.00,  -0.25,   7.40,
23633            -7.90,  -0.04,   0.00,  -0.18,  -0.17,  -6.09,   8.40,  -0.04,
23634             0.00,   0.19,   0.14,  -6.94,  -7.49,   0.00,   0.00,  -0.17,
23635 
23636        /* 1364-1491 */
23637             0.16,   6.92,   7.50,   0.04,   0.00,   0.17,  -0.15,   6.20,
23638             8.09,   0.00,   0.00,   0.18,  -0.14,  -6.12,   7.80,   0.04,
23639             0.00,   0.17,   0.14,   5.85,  -7.50,   0.00,   0.00,  -0.17,
23640            -0.13,  -6.48,   6.90,   0.08,   0.10,   0.15,   0.14,   0.01,
23641             6.32,   6.90,   0.00,   0.00,   0.15,  -0.14,   5.61,  -7.20,
23642             0.00,   0.00,  -0.16,  -0.13,   9.07,   0.00,   0.00,   0.00,
23643             0.00,  -0.20,   5.25,   6.90,   0.00,   0.00,   0.15,  -0.12,
23644            -8.47,  -0.40,   0.00,   0.00,   0.00,   0.19,   6.32,  -5.39,
23645            -1.11,   1.10,  -0.12,  -0.14,   0.02,   0.02,   5.73,  -6.10,
23646            -0.04,   0.00,  -0.14,  -0.13,   4.70,   6.60,  -0.04,   0.00,
23647             0.15,  -0.11,  -4.90,  -6.40,   0.00,   0.00,  -0.14,   0.11,
23648            -5.33,   5.60,   0.04,   0.10,   0.13,   0.12,   0.01,  -4.81,
23649             6.00,   0.04,   0.00,   0.13,   0.11,   5.13,   5.50,   0.04,
23650             0.00,   0.12,  -0.11,   4.50,   5.90,   0.00,   0.00,   0.13,
23651            -0.10,  -4.22,   6.10,   0.00,   0.00,   0.14,  -4.53,   5.70,
23652             0.00,   0.00,   0.13,   0.10,   4.18,   5.70,   0.00,   0.00,
23653 
23654        /* 1492-1619 */
23655             0.13,  -4.75,  -5.19,   0.00,   0.00,  -0.12,   0.11,  -4.06,
23656             5.60,   0.00,   0.00,   0.13,  -3.98,   5.60,  -0.04,   0.00,
23657             0.13,   4.02,  -5.40,   0.00,   0.00,  -0.12,   4.49,  -4.90,
23658            -0.04,   0.00,  -0.11,  -0.10,  -3.62,  -5.40,  -0.16,   0.20,
23659            -0.12,   0.00,   0.01,   4.38,   4.80,   0.00,   0.00,   0.11,
23660            -6.40,  -0.10,   0.00,   0.00,   0.00,   0.14,  -3.98,   5.00,
23661             0.04,   0.00,   0.11,  -3.82,  -5.00,   0.00,   0.00,  -0.11,
23662            -3.71,   5.07,   0.00,   0.00,   0.11,   4.14,   4.40,   0.00,
23663             0.00,   0.10,  -6.01,  -0.50,  -0.04,   0.00,   0.00,   0.13,
23664            -4.04,   4.39,   0.00,   0.00,   0.10,   3.45,  -4.72,   0.00,
23665             0.00,  -0.11,   3.31,   4.71,   0.00,   0.00,   0.11,   3.26,
23666            -4.50,   0.00,   0.00,  -0.10,  -3.26,  -4.50,   0.00,   0.00,
23667            -0.10,  -3.34,  -4.40,   0.00,   0.00,  -0.10,  -3.74,  -4.00,
23668             3.70,   4.00,   3.34,  -4.30,   3.30,  -4.30,  -3.66,   3.90,
23669             0.04,   3.66,   3.90,   0.04,  -3.62,  -3.90,  -3.61,   3.90,
23670            -0.20,   5.30,   0.00,   0.00,   0.12,   3.06,   4.30,   3.30,
23671 
23672        /* 1620-1747 */
23673             4.00,   0.40,   0.20,   3.10,   4.10,  -3.06,   3.90,  -3.30,
23674            -3.60,  -3.30,   3.36,   0.01,   3.14,   3.40,  -4.57,  -0.20,
23675             0.00,   0.00,   0.00,   0.10,  -2.70,  -3.60,   2.94,  -3.20,
23676            -2.90,   3.20,   2.47,  -3.40,   2.55,  -3.30,   2.80,  -3.08,
23677             2.51,   3.30,  -4.10,   0.30,  -0.12,  -0.10,   4.10,   0.20,
23678            -2.74,   3.00,   2.46,   3.23,  -3.66,   1.20,  -0.20,   0.20,
23679             3.74,  -0.40,  -2.51,  -2.80,  -3.74,   2.27,  -2.90,   0.00,
23680             0.00,  -2.50,   2.70,  -2.51,   2.60,  -3.50,   0.20,   3.38,
23681            -2.22,  -2.50,   3.26,  -0.40,   1.95,  -2.60,   3.22,  -0.40,
23682            -0.04,  -1.79,  -2.60,   1.91,   2.50,   0.74,   3.05,  -0.04,
23683             0.08,   2.11,  -2.30,  -2.11,   2.20,  -1.87,  -2.40,   2.03,
23684            -2.20,  -2.03,   2.20,   2.98,   0.00,   0.00,   2.98,  -1.71,
23685             2.40,   2.94,  -0.10,  -0.12,   0.10,   1.67,   2.40,  -1.79,
23686             2.30,  -1.79,   2.20,  -1.67,   2.20,   1.79,  -2.00,   1.87,
23687            -1.90,   1.63,  -2.10,  -1.59,   2.10,   1.55,  -2.10,  -1.55,
23688             2.10,  -2.59,  -0.20,  -1.75,  -1.90,  -1.75,   1.90,  -1.83,
23689 
23690        /* 1748-1875 */
23691            -1.80,   1.51,   2.00,  -1.51,  -2.00,   1.71,   1.80,   1.31,
23692             2.10,  -1.43,   2.00,   1.43,   2.00,  -2.43,  -1.51,   1.90,
23693            -1.47,   1.90,   2.39,   0.20,  -2.39,   1.39,   1.90,   1.39,
23694            -1.80,   1.47,  -1.60,   1.47,  -1.60,   1.43,  -1.50,  -1.31,
23695             1.60,   1.27,  -1.60,  -1.27,   1.60,   1.27,  -1.60,   2.03,
23696             1.35,   1.50,  -1.39,  -1.40,   1.95,  -0.20,  -1.27,   1.49,
23697             1.19,   1.50,   1.27,   1.40,   1.15,   1.50,   1.87,  -0.10,
23698            -1.12,  -1.50,   1.87,  -1.11,  -1.50,  -1.11,  -1.50,   0.00,
23699             0.00,   1.19,   1.40,   1.27,  -1.30,  -1.27,  -1.30,  -1.15,
23700             1.40,  -1.23,   1.30,  -1.23,  -1.30,   1.22,  -1.29,   1.07,
23701            -1.40,   1.75,  -0.20,  -1.03,  -1.40,  -1.07,   1.20,  -1.03,
23702             1.15,   1.07,   1.10,   1.51,  -1.03,   1.10,   1.03,  -1.10,
23703             0.00,   0.00,  -1.03,  -1.10,   0.91,  -1.20,  -0.88,  -1.20,
23704            -0.88,   1.20,  -0.95,   1.10,  -0.95,  -1.10,   1.43,  -1.39,
23705             0.95,  -1.00,  -0.95,   1.00,  -0.80,   1.10,   0.91,  -1.00,
23706            -1.35,   0.88,   1.00,  -0.83,   1.00,  -0.91,   0.90,   0.91,
23707 
23708        /* 1876-2003 */
23709             0.90,   0.88,  -0.90,  -0.76,  -1.00,  -0.76,   1.00,   0.76,
23710             1.00,  -0.72,   1.00,   0.84,  -0.90,   0.84,   0.90,   1.23,
23711             0.00,   0.00,  -0.52,  -1.10,  -0.68,   1.00,   1.19,  -0.20,
23712             1.19,   0.76,   0.90,   1.15,  -0.10,   1.15,  -0.10,   0.72,
23713            -0.90,  -1.15,  -1.15,   0.68,   0.90,  -0.68,   0.90,  -1.11,
23714             0.00,   0.00,   0.20,   0.79,   0.80,  -1.11,  -0.10,   0.00,
23715             0.00,  -0.48,  -1.00,  -0.76,  -0.80,  -0.72,  -0.80,  -1.07,
23716            -0.10,   0.64,   0.80,  -0.64,  -0.80,   0.64,   0.80,   0.40,
23717             0.60,   0.52,  -0.50,  -0.60,  -0.80,  -0.71,   0.70,  -0.99,
23718             0.99,   0.56,   0.80,  -0.56,   0.80,   0.68,  -0.70,   0.68,
23719             0.70,  -0.95,  -0.64,   0.70,   0.64,   0.70,  -0.60,   0.70,
23720            -0.60,  -0.70,  -0.91,  -0.10,  -0.51,   0.76,  -0.91,  -0.56,
23721             0.70,   0.88,   0.88,  -0.63,  -0.60,   0.55,  -0.60,  -0.80,
23722             0.80,  -0.80,  -0.52,   0.60,   0.52,   0.60,   0.52,  -0.60,
23723            -0.48,   0.60,   0.48,   0.60,   0.48,   0.60,  -0.76,   0.44,
23724            -0.60,   0.52,  -0.50,  -0.52,   0.50,   0.40,   0.60,  -0.40,
23725 
23726        /* 2004-2131 */
23727            -0.60,   0.40,  -0.60,   0.72,  -0.72,  -0.51,  -0.50,  -0.48,
23728             0.50,   0.48,  -0.50,  -0.48,   0.50,  -0.48,   0.50,   0.48,
23729            -0.50,  -0.48,  -0.50,  -0.68,  -0.68,   0.44,   0.50,  -0.64,
23730            -0.10,  -0.64,  -0.10,  -0.40,   0.50,   0.40,   0.50,   0.40,
23731             0.50,   0.00,   0.00,  -0.40,  -0.50,  -0.36,  -0.50,   0.36,
23732            -0.50,   0.60,  -0.60,   0.40,  -0.40,   0.40,   0.40,  -0.40,
23733             0.40,  -0.40,   0.40,  -0.56,  -0.56,   0.36,  -0.40,  -0.36,
23734             0.40,   0.36,  -0.40,  -0.36,  -0.40,   0.36,   0.40,   0.36,
23735             0.40,  -0.52,   0.52,   0.52,   0.32,   0.40,  -0.32,   0.40,
23736            -0.32,   0.40,  -0.32,   0.40,   0.32,  -0.40,  -0.32,  -0.40,
23737             0.32,  -0.40,   0.28,  -0.40,  -0.28,   0.40,   0.28,  -0.40,
23738             0.28,   0.40,   0.48,  -0.48,   0.48,   0.36,  -0.30,  -0.36,
23739            -0.30,   0.00,   0.00,   0.20,   0.40,  -0.44,   0.44,  -0.44,
23740            -0.44,  -0.44,  -0.44,   0.32,  -0.30,   0.32,   0.30,   0.24,
23741             0.30,  -0.12,  -0.10,  -0.28,   0.30,   0.28,   0.30,   0.28,
23742             0.30,   0.28,  -0.30,   0.28,  -0.30,   0.28,  -0.30,   0.28,
23743 
23744        /* 2132-2259 */
23745             0.30,  -0.28,   0.30,   0.40,   0.40,  -0.24,   0.30,   0.24,
23746            -0.30,   0.24,  -0.30,  -0.24,  -0.30,   0.24,   0.30,   0.24,
23747            -0.30,  -0.24,   0.30,   0.24,  -0.30,  -0.24,  -0.30,   0.24,
23748            -0.30,   0.24,   0.30,  -0.24,   0.30,  -0.24,   0.30,   0.20,
23749            -0.30,   0.20,  -0.30,   0.20,  -0.30,   0.20,   0.30,   0.20,
23750            -0.30,   0.20,  -0.30,   0.20,   0.30,   0.20,   0.30,  -0.20,
23751            -0.30,   0.20,  -0.30,   0.20,  -0.30,  -0.36,  -0.36,  -0.36,
23752            -0.04,   0.30,   0.12,  -0.10,  -0.32,  -0.24,   0.20,   0.24,
23753             0.20,   0.20,  -0.20,  -0.20,  -0.20,  -0.20,  -0.20,   0.20,
23754             0.20,   0.20,  -0.20,   0.20,   0.20,   0.20,   0.20,  -0.20,
23755            -0.20,   0.00,   0.00,  -0.20,  -0.20,  -0.20,   0.20,  -0.20,
23756             0.20,   0.20,  -0.20,  -0.20,  -0.20,   0.20,   0.20,   0.20,
23757             0.20,   0.20,  -0.20,   0.20,  -0.20,   0.28,   0.28,   0.28,
23758             0.28,   0.28,   0.28,  -0.28,   0.28,   0.12,   0.00,   0.24,
23759             0.16,  -0.20,   0.16,  -0.20,   0.16,  -0.20,   0.16,   0.20,
23760            -0.16,   0.20,   0.16,   0.20,  -0.16,   0.20,  -0.16,   0.20,
23761 
23762        /* 2260-2387 */
23763            -0.16,   0.20,   0.16,  -0.20,   0.16,   0.20,   0.16,  -0.20,
23764            -0.16,   0.20,  -0.16,  -0.20,  -0.16,   0.20,   0.16,   0.20,
23765             0.16,  -0.20,   0.16,  -0.20,   0.16,   0.20,   0.16,   0.20,
23766             0.16,   0.20,  -0.16,  -0.20,   0.16,   0.20,  -0.16,   0.20,
23767             0.16,   0.20,  -0.16,  -0.20,   0.16,  -0.20,   0.16,  -0.20,
23768            -0.16,  -0.20,   0.24,  -0.24,  -0.24,   0.24,   0.24,   0.12,
23769             0.20,   0.12,   0.20,  -0.12,  -0.20,   0.12,  -0.20,   0.12,
23770            -0.20,  -0.12,   0.20,  -0.12,   0.20,  -0.12,  -0.20,   0.12,
23771             0.20,   0.12,   0.20,   0.12,  -0.20,  -0.12,   0.20,   0.12,
23772            -0.20,  -0.12,   0.20,   0.12,   0.20,   0.00,   0.00,  -0.12,
23773             0.20,  -0.12,   0.20,   0.12,  -0.20,  -0.12,   0.20,   0.12,
23774             0.20,   0.00,  -0.21,  -0.20,   0.00,   0.00,   0.20,  -0.20,
23775            -0.20,  -0.20,   0.20,  -0.16,  -0.10,   0.00,   0.17,   0.16,
23776             0.16,   0.16,   0.16,  -0.16,   0.16,   0.16,  -0.16,   0.16,
23777            -0.16,   0.16,   0.12,   0.10,   0.12,  -0.10,  -0.12,   0.10,
23778            -0.12,   0.10,   0.12,  -0.10,  -0.12,   0.12,  -0.12,   0.12,
23779 
23780        /* 2388-2515 */
23781            -0.12,   0.12,  -0.12,  -0.12,  -0.12,  -0.12,  -0.12,  -0.12,
23782            -0.12,   0.12,   0.12,   0.12,   0.12,  -0.12,  -0.12,   0.12,
23783             0.12,   0.12,  -0.12,   0.12,  -0.12,  -0.12,  -0.12,   0.12,
23784            -0.12,  -0.12,   0.12,   0.00,   0.11,   0.11,-122.67, 164.70,
23785           203.78, 273.50,   3.58,   2.74,   6.18,  -4.56,   0.00,  -0.04,
23786             0.00,  -0.07,  57.44, -77.10,  95.82, 128.60,  -1.77,  -1.28,
23787             2.85,  -2.14,  82.14,  89.50,   0.00,   0.00,   2.00,  -1.84,
23788            -0.04,  47.73, -64.10,  23.79,  31.90,  -1.45,  -1.07,   0.69,
23789            -0.53, -46.38,  50.50,   0.00,   0.00,   1.13,   1.04,   0.02,
23790           -18.38,   0.00,  63.80,   0.00,   0.00,   0.41,   0.00,  -1.43,
23791            59.07,   0.00,   0.00,   0.00,   0.00,  -1.32,  57.28,   0.00,
23792             0.00,   0.00,   0.00,  -1.28, -48.65,   0.00,  -1.15,   0.00,
23793             0.00,   1.09,   0.00,   0.03, -18.30,  24.60, -17.30, -23.20,
23794             0.56,   0.41,  -0.51,   0.39, -16.91,  26.90,   8.43,  13.30,
23795             0.60,   0.38,   0.31,  -0.19,   1.23,  -1.70, -19.13, -25.70,
23796            -0.03,  -0.03,  -0.58,   0.43,  -0.72,   0.90, -17.34, -23.30,
23797 
23798        /* 2516-2643 */
23799             0.03,   0.02,  -0.52,   0.39, -19.49, -21.30,   0.00,   0.00,
23800            -0.48,   0.44,   0.01,  20.57, -20.10,   0.64,   0.70,  -0.45,
23801            -0.46,   0.00,  -0.01,   4.89,   5.90, -16.55,  19.90,   0.14,
23802            -0.11,   0.44,   0.37,  18.22,  19.80,   0.00,   0.00,   0.44,
23803            -0.41,  -0.01,   4.89,  -5.30, -16.51, -18.00,  -0.11,  -0.11,
23804            -0.41,   0.37, -17.86,   0.00,  17.10,   0.00,   0.00,   0.40,
23805             0.00,  -0.38,   0.32,   0.00,  24.42,   0.00,   0.00,  -0.01,
23806             0.00,  -0.55, -23.79,   0.00,   0.00,   0.00,   0.00,   0.53,
23807            14.72, -16.00,  -0.32,   0.00,  -0.36,  -0.33,  -0.01,   0.01,
23808             3.34,  -4.50,  11.86,  15.90,  -0.11,  -0.07,   0.35,  -0.27,
23809            -3.26,   4.40,  11.62,  15.60,   0.09,   0.07,   0.35,  -0.26,
23810           -19.53,   0.00,   5.09,   0.00,   0.00,   0.44,   0.00,  -0.11,
23811           -13.48,  14.70,   0.00,   0.00,   0.33,   0.30,   0.01,  10.86,
23812           -14.60,   3.18,   4.30,  -0.33,  -0.24,   0.09,  -0.07, -11.30,
23813           -15.10,   0.00,   0.00,  -0.34,   0.25,   0.01,   2.03,  -2.70,
23814            10.82,  14.50,  -0.07,  -0.05,   0.32,  -0.24,  17.46,   0.00,
23815 
23816        /* 2644-2771 */
23817             0.00,   0.00,   0.00,  -0.39,  16.43,   0.00,   0.52,   0.00,
23818             0.00,  -0.37,   0.00,  -0.01,   9.35,   0.00,  13.29,   0.00,
23819             0.00,  -0.21,   0.00,  -0.30, -10.42,  11.40,   0.00,   0.00,
23820             0.25,   0.23,   0.01,   0.44,   0.50, -10.38,  11.30,   0.02,
23821            -0.01,   0.25,   0.23, -14.64,   0.00,   0.00,   0.00,   0.00,
23822             0.33,   0.56,   0.80,  -8.67,  11.70,   0.02,  -0.01,   0.26,
23823             0.19,  13.88,   0.00,  -2.47,   0.00,   0.00,  -0.31,   0.00,
23824             0.06,  -1.99,   2.70,   7.72,  10.30,   0.06,   0.04,   0.23,
23825            -0.17,  -0.20,   0.00,  13.05,   0.00,   0.00,   0.00,   0.00,
23826            -0.29,   6.92,  -9.30,   3.34,   4.50,  -0.21,  -0.15,   0.10,
23827            -0.07,  -6.60,   0.00,  10.70,   0.00,   0.00,   0.15,   0.00,
23828            -0.24,  -8.04,  -8.70,   0.00,   0.00,  -0.19,   0.18, -10.58,
23829             0.00,  -3.10,   0.00,   0.00,   0.24,   0.00,   0.07,  -7.32,
23830             8.00,  -0.12,  -0.10,   0.18,   0.16,   1.63,   1.70,   6.96,
23831            -7.60,   0.03,  -0.04,  -0.17,  -0.16,  -3.62,   0.00,   9.86,
23832             0.00,   0.00,   0.08,   0.00,  -0.22,   0.20,  -0.20,  -6.88,
23833 
23834        /* 2772-2899 */
23835            -7.50,   0.00,   0.00,  -0.17,   0.15,  -8.99,   0.00,   4.02,
23836             0.00,   0.00,   0.20,   0.00,  -0.09,  -1.07,   1.40,  -5.69,
23837            -7.70,   0.03,   0.02,  -0.17,   0.13,   6.48,  -7.20,  -0.48,
23838            -0.50,  -0.16,  -0.14,  -0.01,   0.01,   5.57,  -7.50,   1.07,
23839             1.40,  -0.17,  -0.12,   0.03,  -0.02,   8.71,   0.00,   3.54,
23840             0.00,   0.00,  -0.19,   0.00,  -0.08,   0.40,   0.00,   9.27,
23841             0.00,   0.00,  -0.01,   0.00,  -0.21,  -6.13,   6.70,  -1.19,
23842            -1.30,   0.15,   0.14,  -0.03,   0.03,   5.21,  -5.70,  -2.51,
23843            -2.60,  -0.13,  -0.12,  -0.06,   0.06,   5.69,  -6.20,  -0.12,
23844            -0.10,  -0.14,  -0.13,  -0.01,   2.03,  -2.70,   4.53,   6.10,
23845            -0.06,  -0.05,   0.14,  -0.10,   5.01,   5.50,  -2.51,   2.70,
23846             0.12,  -0.11,   0.06,   0.06,  -1.91,   2.60,  -4.38,  -5.90,
23847             0.06,   0.04,  -0.13,   0.10,   4.65,  -6.30,   0.00,   0.00,
23848            -0.14,  -0.10,  -5.29,   5.70,   0.00,   0.00,   0.13,   0.12,
23849            -2.23,  -4.00,  -4.65,   4.20,  -0.09,   0.05,   0.10,   0.10,
23850            -4.53,   6.10,   0.00,   0.00,   0.14,   0.10,   2.47,   2.70,
23851 
23852        /* 2900-3027 */
23853            -4.46,   4.90,   0.06,  -0.06,   0.11,   0.10,  -5.05,   5.50,
23854             0.84,   0.90,   0.12,   0.11,   0.02,  -0.02,   4.97,  -5.40,
23855            -1.71,   0.00,  -0.12,  -0.11,   0.00,   0.04,  -0.99,  -1.30,
23856             4.22,  -5.70,  -0.03,   0.02,  -0.13,  -0.09,   0.99,   1.40,
23857             4.22,  -5.60,   0.03,  -0.02,  -0.13,  -0.09,  -4.69,  -5.20,
23858             0.00,   0.00,  -0.12,   0.10,  -3.42,   0.00,   6.09,   0.00,
23859             0.00,   0.08,   0.00,  -0.14,  -4.65,  -5.10,   0.00,   0.00,
23860            -0.11,   0.10,   0.00,   0.00,  -4.53,  -5.00,   0.00,   0.00,
23861            -0.11,   0.10,  -2.43,  -2.70,  -3.82,   4.20,  -0.06,   0.05,
23862             0.10,   0.09,   0.00,   0.00,  -4.53,   4.90,   0.00,   0.00,
23863             0.11,   0.10,  -4.49,  -4.90,   0.00,   0.00,  -0.11,   0.10,
23864             2.67,  -2.90,  -3.62,  -3.90,  -0.06,  -0.06,  -0.09,   0.08,
23865             3.94,  -5.30,   0.00,   0.00,  -0.12,  -3.38,   3.70,  -2.78,
23866            -3.10,   0.08,   0.08,  -0.07,   0.06,   3.18,  -3.50,  -2.82,
23867            -3.10,  -0.08,  -0.07,  -0.07,   0.06,  -5.77,   0.00,   1.87,
23868             0.00,   0.00,   0.13,   0.00,  -0.04,   3.54,  -4.80,  -0.64,
23869 
23870        /* 3028-3155 */
23871            -0.90,  -0.11,   0.00,  -0.02,  -3.50,  -4.70,   0.68,  -0.90,
23872            -0.11,   0.00,  -0.02,   5.49,   0.00,   0.00,   0.00,   0.00,
23873            -0.12,   1.83,  -2.50,   2.63,   3.50,  -0.06,   0.00,   0.08,
23874             3.02,  -4.10,   0.68,   0.90,  -0.09,   0.00,   0.02,   0.00,
23875             0.00,   5.21,   0.00,   0.00,   0.00,   0.00,  -0.12,  -3.54,
23876             3.80,   2.70,   3.60,  -1.35,   1.80,   0.08,   0.00,   0.04,
23877            -2.90,   3.90,   0.68,   0.90,   0.09,   0.00,   0.02,   0.80,
23878            -1.10,  -2.78,  -3.70,  -0.02,   0.00,  -0.08,   4.10,   0.00,
23879            -2.39,   0.00,   0.00,  -0.09,   0.00,   0.05,  -1.59,   2.10,
23880             2.27,   3.00,   0.05,   0.00,   0.07,  -2.63,   3.50,  -0.48,
23881            -0.60,  -2.94,  -3.20,  -2.94,   3.20,   2.27,  -3.00,  -1.11,
23882            -1.50,  -0.07,   0.00,  -0.03,  -0.56,  -0.80,  -2.35,   3.10,
23883             0.00,  -0.60,  -3.42,   1.90,  -0.12,  -0.10,   2.63,  -2.90,
23884             2.51,   2.80,  -0.64,   0.70,  -0.48,  -0.60,   2.19,  -2.90,
23885             0.24,  -0.30,   2.15,   2.90,   2.15,  -2.90,   0.52,   0.70,
23886             2.07,  -2.80,  -3.10,   0.00,   1.79,   0.00,   0.00,   0.07,
23887 
23888        /* 3156-3283 */
23889             0.00,  -0.04,   0.88,   0.00,  -3.46,   2.11,   2.80,  -0.36,
23890             0.50,   3.54,  -0.20,  -3.50,  -1.39,   1.50,  -1.91,  -2.10,
23891            -1.47,   2.00,   1.39,   1.90,   2.07,  -2.30,   0.91,   1.00,
23892             1.99,  -2.70,   3.30,   0.00,   0.60,  -0.44,  -0.70,  -1.95,
23893             2.60,   2.15,  -2.40,  -0.60,  -0.70,   3.30,   0.84,   0.00,
23894            -3.10,  -3.10,   0.00,  -0.72,  -0.32,   0.40,  -1.87,  -2.50,
23895             1.87,  -2.50,   0.32,   0.40,  -0.24,   0.30,  -1.87,  -2.50,
23896            -0.24,  -0.30,   1.87,  -2.50,  -2.70,   0.00,   1.55,   2.03,
23897             2.20,  -2.98,  -1.99,  -2.20,   0.12,  -0.10,  -0.40,   0.50,
23898             1.59,   2.10,   0.00,   0.00,  -1.79,   2.00,  -1.03,   1.40,
23899            -1.15,  -1.60,   0.32,   0.50,   1.39,  -1.90,   2.35,  -1.27,
23900             1.70,   0.60,   0.80,  -0.32,  -0.40,   1.35,  -1.80,   0.44,
23901             0.00,   2.23,  -0.84,   0.90,  -1.27,  -1.40,  -1.47,   1.60,
23902            -0.28,  -0.30,  -0.28,   0.40,  -1.27,  -1.70,   0.28,  -0.40,
23903            -1.43,  -1.50,   0.00,   0.00,  -1.27,  -1.70,   2.11,  -0.32,
23904            -0.40,  -1.23,   1.60,   1.19,  -1.30,  -0.72,  -0.80,   0.72,
23905 
23906        /* 3284-3411 */
23907            -0.80,  -1.15,  -1.30,  -1.35,  -1.50,  -1.19,  -1.60,  -0.12,
23908             0.20,   1.79,   0.00,  -0.88,  -0.28,   0.40,   1.11,   1.50,
23909            -1.83,   0.00,   0.56,  -0.12,   0.10,  -1.27,  -1.40,   0.00,
23910             0.00,   1.15,   1.50,  -0.12,   0.20,   1.11,   1.50,   0.36,
23911            -0.50,  -1.07,  -1.40,  -1.11,   1.50,   1.67,   0.00,   0.80,
23912            -1.11,   0.00,   1.43,   1.23,  -1.30,  -0.24,  -1.19,  -1.30,
23913            -0.24,   0.20,  -0.44,  -0.90,  -0.95,   1.10,   1.07,  -1.40,
23914             1.15,  -1.30,   1.03,  -1.10,  -0.56,  -0.60,  -0.68,   0.90,
23915            -0.76,  -1.00,  -0.24,  -0.30,   0.95,  -1.30,   0.56,   0.70,
23916             0.84,  -1.10,  -0.56,   0.00,  -1.55,   0.91,  -1.30,   0.28,
23917             0.30,   0.16,  -0.20,   0.95,   1.30,   0.40,  -0.50,  -0.88,
23918            -1.20,   0.95,  -1.10,  -0.48,  -0.50,   0.00,   0.00,  -1.07,
23919             1.20,   0.44,  -0.50,   0.95,   1.10,   0.00,   0.00,   0.92,
23920            -1.30,   0.95,   1.00,  -0.52,   0.60,   1.59,   0.24,  -0.40,
23921             0.91,   1.20,   0.84,  -1.10,  -0.44,  -0.60,   0.84,   1.10,
23922            -0.44,   0.60,  -0.44,   0.60,  -0.84,  -1.10,  -0.80,   0.00,
23923 
23924        /* 3412-3539 */
23925             1.35,   0.76,   0.20,  -0.91,  -1.00,   0.20,  -0.30,  -0.91,
23926            -1.20,  -0.95,   1.00,  -0.48,  -0.50,   0.88,   1.00,   0.48,
23927            -0.50,  -0.95,  -1.10,   0.20,  -0.20,  -0.99,   1.10,  -0.84,
23928             1.10,  -0.24,  -0.30,   0.20,  -0.30,   0.84,   1.10,  -1.39,
23929             0.00,  -0.28,  -0.16,   0.20,   0.84,   1.10,   0.00,   0.00,
23930             1.39,   0.00,   0.00,  -0.95,   1.00,   1.35,  -0.99,   0.00,
23931             0.88,  -0.52,   0.00,  -1.19,   0.20,   0.20,   0.76,  -1.00,
23932             0.00,   0.00,   0.76,   1.00,   0.00,   0.00,   0.76,   1.00,
23933            -0.76,   1.00,   0.00,   0.00,   1.23,   0.76,   0.80,  -0.32,
23934             0.40,  -0.72,   0.80,  -0.40,  -0.40,   0.00,   0.00,  -0.80,
23935            -0.90,  -0.68,   0.90,  -0.16,  -0.20,  -0.16,  -0.20,   0.68,
23936            -0.90,  -0.36,   0.50,  -0.56,  -0.80,   0.72,  -0.90,   0.44,
23937            -0.60,  -0.48,  -0.70,  -0.16,   0.00,  -1.11,   0.32,   0.00,
23938            -1.07,   0.60,  -0.80,  -0.28,  -0.40,  -0.64,   0.00,   0.91,
23939             1.11,   0.64,  -0.90,   0.76,  -0.80,   0.00,   0.00,  -0.76,
23940            -0.80,   1.03,   0.00,  -0.36,  -0.64,  -0.70,   0.36,  -0.40,
23941 
23942        /* 3540-3667 */
23943             1.07,   0.36,  -0.50,  -0.52,  -0.70,   0.60,   0.00,   0.88,
23944             0.95,   0.00,   0.48,   0.16,  -0.20,   0.60,   0.80,   0.16,
23945            -0.20,  -0.60,  -0.80,   0.00,  -1.00,   0.12,   0.20,   0.16,
23946            -0.20,   0.68,   0.70,   0.59,  -0.80,  -0.99,  -0.56,  -0.60,
23947             0.36,  -0.40,  -0.68,  -0.70,  -0.68,  -0.70,  -0.36,  -0.50,
23948            -0.44,   0.60,   0.64,   0.70,  -0.12,   0.10,  -0.52,   0.60,
23949             0.36,   0.40,   0.00,   0.00,   0.95,  -0.84,   0.00,   0.44,
23950             0.56,   0.60,   0.32,  -0.30,   0.00,   0.00,   0.60,   0.70,
23951             0.00,   0.00,   0.60,   0.70,  -0.12,  -0.20,   0.52,  -0.70,
23952             0.00,   0.00,   0.56,   0.70,  -0.12,   0.10,  -0.52,  -0.70,
23953             0.00,   0.00,   0.88,  -0.76,   0.00,  -0.44,   0.00,   0.00,
23954            -0.52,  -0.70,   0.52,  -0.70,   0.36,  -0.40,  -0.44,  -0.50,
23955             0.00,   0.00,   0.60,   0.60,   0.84,   0.00,   0.12,  -0.24,
23956             0.00,   0.80,  -0.56,   0.60,  -0.32,  -0.30,   0.48,  -0.50,
23957             0.28,  -0.30,  -0.48,  -0.50,   0.12,   0.20,   0.48,  -0.60,
23958             0.48,   0.60,  -0.12,   0.20,   0.24,   0.00,   0.76,  -0.52,
23959 
23960        /* 3668-3795 */
23961            -0.60,  -0.52,   0.60,   0.48,  -0.50,  -0.24,  -0.30,   0.12,
23962            -0.10,   0.48,   0.60,   0.52,  -0.20,   0.36,   0.40,  -0.44,
23963             0.50,  -0.24,  -0.30,  -0.48,  -0.60,  -0.44,  -0.60,  -0.12,
23964             0.10,   0.76,   0.76,   0.20,  -0.20,   0.48,   0.50,   0.40,
23965            -0.50,  -0.24,  -0.30,   0.44,  -0.60,   0.44,  -0.60,   0.36,
23966             0.00,  -0.64,   0.72,   0.00,  -0.12,   0.00,  -0.10,  -0.40,
23967            -0.60,  -0.20,  -0.20,  -0.44,   0.50,  -0.44,   0.50,   0.20,
23968             0.20,  -0.44,  -0.50,   0.20,  -0.20,  -0.20,   0.20,  -0.44,
23969            -0.50,   0.64,   0.00,   0.32,  -0.36,   0.50,  -0.20,  -0.30,
23970             0.12,  -0.10,   0.48,   0.50,  -0.12,   0.30,  -0.36,  -0.50,
23971             0.00,   0.00,   0.48,   0.50,  -0.48,   0.50,   0.68,   0.00,
23972            -0.12,   0.56,  -0.40,   0.44,  -0.50,  -0.12,  -0.10,   0.24,
23973             0.30,  -0.40,   0.40,   0.64,   0.00,  -0.24,   0.64,   0.00,
23974            -0.20,   0.00,   0.00,   0.44,  -0.50,   0.44,   0.50,  -0.12,
23975             0.20,  -0.36,  -0.50,   0.12,   0.00,   0.64,  -0.40,   0.50,
23976             0.00,   0.10,   0.00,   0.00,  -0.40,   0.50,   0.00,   0.00,
23977 
23978        /* 3796-3923 */
23979            -0.40,  -0.50,   0.56,   0.00,   0.28,   0.00,   0.10,   0.36,
23980             0.50,   0.00,  -0.10,   0.36,  -0.50,   0.36,   0.50,   0.00,
23981            -0.10,   0.24,  -0.20,  -0.36,  -0.40,   0.16,   0.20,   0.40,
23982            -0.40,   0.00,   0.00,  -0.36,  -0.50,  -0.36,  -0.50,  -0.32,
23983            -0.50,  -0.12,   0.10,   0.20,   0.20,  -0.36,   0.40,  -0.60,
23984             0.60,   0.28,   0.00,   0.52,   0.12,  -0.10,   0.40,   0.40,
23985             0.00,  -0.50,   0.20,  -0.20,  -0.32,   0.40,   0.16,   0.20,
23986            -0.16,   0.20,   0.32,   0.40,   0.56,   0.00,  -0.12,   0.32,
23987            -0.40,  -0.16,  -0.20,   0.00,   0.00,   0.40,   0.40,  -0.40,
23988            -0.40,  -0.40,   0.40,  -0.36,   0.40,   0.12,   0.10,   0.00,
23989             0.10,   0.36,   0.40,   0.00,  -0.10,   0.36,   0.40,  -0.36,
23990             0.40,   0.00,   0.10,   0.32,   0.00,   0.44,   0.12,   0.20,
23991             0.28,  -0.40,   0.00,   0.00,   0.36,   0.40,   0.32,  -0.40,
23992            -0.16,   0.12,   0.10,   0.32,  -0.40,   0.20,   0.30,  -0.24,
23993             0.30,   0.00,   0.10,   0.32,   0.40,   0.00,  -0.10,  -0.32,
23994            -0.40,  -0.32,   0.40,   0.00,   0.10,  -0.52,  -0.52,   0.52,
23995 
23996        /* 3924-4051 */
23997             0.32,  -0.40,   0.00,   0.00,   0.32,   0.40,   0.32,  -0.40,
23998             0.00,   0.00,  -0.32,  -0.40,  -0.32,   0.40,   0.32,   0.40,
23999             0.00,   0.00,   0.32,   0.40,   0.00,   0.00,  -0.32,  -0.40,
24000             0.00,   0.00,   0.32,   0.40,   0.16,   0.20,   0.32,  -0.30,
24001            -0.16,   0.00,  -0.48,  -0.20,   0.20,  -0.28,  -0.30,   0.28,
24002            -0.40,   0.00,   0.00,   0.28,  -0.40,   0.00,   0.00,   0.28,
24003            -0.40,   0.00,   0.00,  -0.28,  -0.40,   0.28,   0.40,  -0.28,
24004            -0.40,  -0.48,  -0.20,   0.20,   0.24,   0.30,   0.44,   0.00,
24005             0.16,   0.24,   0.30,   0.16,  -0.20,   0.24,   0.30,  -0.12,
24006             0.20,   0.20,   0.30,  -0.16,   0.20,   0.00,   0.00,   0.44,
24007            -0.32,   0.30,   0.24,   0.00,  -0.36,   0.36,   0.00,   0.24,
24008             0.12,  -0.20,   0.20,   0.30,  -0.12,   0.00,  -0.28,   0.30,
24009            -0.24,   0.30,   0.12,   0.10,  -0.28,  -0.30,  -0.28,   0.30,
24010             0.00,   0.00,  -0.28,  -0.30,   0.00,   0.00,  -0.28,  -0.30,
24011             0.00,   0.00,   0.28,   0.30,   0.00,   0.00,  -0.28,  -0.30,
24012            -0.28,   0.30,   0.00,   0.00,  -0.28,  -0.30,   0.00,   0.00,
24013 
24014        /* 4052-4179 */
24015             0.28,   0.30,   0.00,   0.00,  -0.28,   0.30,   0.28,  -0.30,
24016            -0.28,   0.30,   0.40,   0.40,  -0.24,   0.30,   0.00,  -0.10,
24017             0.16,   0.00,   0.36,  -0.20,   0.30,  -0.12,  -0.10,  -0.24,
24018            -0.30,   0.00,   0.00,  -0.24,   0.30,  -0.24,   0.30,   0.00,
24019             0.00,  -0.24,   0.30,  -0.24,   0.30,   0.24,  -0.30,   0.00,
24020             0.00,   0.24,  -0.30,   0.00,   0.00,   0.24,   0.30,   0.24,
24021            -0.30,   0.24,   0.30,  -0.24,   0.30,  -0.24,   0.30,  -0.20,
24022             0.20,  -0.16,  -0.20,   0.00,   0.00,  -0.32,   0.20,   0.00,
24023             0.10,   0.20,  -0.30,   0.20,  -0.20,   0.12,   0.20,  -0.16,
24024             0.20,   0.16,   0.20,   0.20,   0.30,   0.20,   0.30,   0.00,
24025             0.00,  -0.20,   0.30,   0.00,   0.00,   0.20,   0.30,  -0.20,
24026            -0.30,  -0.20,  -0.30,   0.20,  -0.30,   0.00,   0.00,   0.20,
24027             0.30,   0.00,   0.00,   0.20,   0.30,   0.00,   0.00,   0.20,
24028             0.30,   0.00,   0.00,   0.20,   0.30,   0.00,   0.00,   0.20,
24029            -0.30,   0.00,   0.00,  -0.20,  -0.30,   0.00,   0.00,  -0.20,
24030             0.30,   0.00,   0.00,  -0.20,   0.30,   0.00,   0.00,   0.36,
24031 
24032        /* 4180-4307 */
24033             0.00,   0.00,   0.36,   0.12,   0.10,  -0.24,   0.20,   0.12,
24034            -0.20,  -0.16,  -0.20,  -0.13,   0.10,   0.22,   0.21,   0.20,
24035             0.00,  -0.28,   0.32,   0.00,  -0.12,  -0.20,  -0.20,   0.12,
24036            -0.10,   0.12,   0.10,  -0.20,   0.20,   0.00,   0.00,  -0.32,
24037             0.32,   0.00,   0.00,   0.32,   0.32,   0.00,   0.00,  -0.24,
24038            -0.20,   0.24,   0.20,   0.20,   0.00,  -0.24,   0.00,   0.00,
24039            -0.24,  -0.20,   0.00,   0.00,   0.24,   0.20,  -0.24,  -0.20,
24040             0.00,   0.00,  -0.24,   0.20,   0.16,  -0.20,   0.12,   0.10,
24041             0.20,   0.20,   0.00,  -0.10,  -0.12,   0.10,  -0.16,  -0.20,
24042            -0.12,  -0.10,  -0.16,   0.20,   0.20,   0.20,   0.00,   0.00,
24043            -0.20,   0.20,  -0.20,   0.20,  -0.20,   0.20,  -0.20,   0.20,
24044             0.20,  -0.20,  -0.20,  -0.20,   0.00,   0.00,  -0.20,   0.20,
24045             0.20,   0.00,  -0.20,   0.00,   0.00,  -0.20,   0.20,  -0.20,
24046             0.20,  -0.20,  -0.20,  -0.20,  -0.20,   0.00,   0.00,   0.20,
24047             0.20,   0.20,   0.20,   0.12,  -0.20,  -0.12,  -0.10,   0.28,
24048            -0.28,   0.16,  -0.20,   0.00,  -0.10,   0.00,   0.10,  -0.16,
24049 
24050        /* 4308-4435 */
24051             0.20,   0.00,  -0.10,  -0.16,  -0.20,   0.00,  -0.10,   0.16,
24052            -0.20,   0.16,  -0.20,   0.00,   0.00,   0.16,   0.20,  -0.16,
24053             0.20,   0.00,   0.00,   0.16,   0.20,   0.16,  -0.20,   0.16,
24054            -0.20,  -0.16,   0.20,   0.16,  -0.20,   0.00,   0.00,   0.16,
24055             0.20,   0.00,   0.00,   0.16,   0.20,   0.00,   0.00,  -0.16,
24056            -0.20,   0.16,  -0.20,  -0.16,  -0.20,   0.00,   0.00,  -0.16,
24057            -0.20,   0.00,   0.00,  -0.16,   0.20,   0.00,   0.00,   0.16,
24058            -0.20,   0.16,   0.20,   0.16,   0.20,   0.00,   0.00,  -0.16,
24059            -0.20,   0.00,   0.00,  -0.16,  -0.20,   0.00,   0.00,   0.16,
24060             0.20,   0.16,   0.20,   0.00,   0.00,   0.16,   0.20,   0.16,
24061            -0.20,   0.16,   0.20,   0.00,   0.00,  -0.16,   0.20,   0.00,
24062             0.10,   0.12,  -0.20,   0.12,  -0.20,   0.00,  -0.10,   0.00,
24063            -0.10,   0.12,   0.20,   0.00,  -0.10,  -0.12,   0.20,  -0.15,
24064             0.20,  -0.24,   0.24,   0.00,   0.00,   0.24,   0.24,   0.12,
24065            -0.20,  -0.12,  -0.20,   0.00,   0.00,   0.12,   0.20,   0.12,
24066            -0.20,   0.12,   0.20,   0.12,   0.20,   0.12,   0.20,   0.12,
24067 
24068        /* 4436-4563 */
24069            -0.20,  -0.12,   0.20,   0.00,   0.00,   0.12,   0.20,   0.12,
24070             0.00,  -0.20,   0.00,   0.00,  -0.12,  -0.20,   0.12,  -0.20,
24071             0.00,   0.00,   0.12,   0.20,  -0.12,   0.20,  -0.12,   0.20,
24072             0.12,  -0.20,   0.00,   0.00,   0.12,   0.20,   0.20,   0.00,
24073             0.12,   0.00,   0.00,  -0.12,   0.20,   0.00,   0.00,  -0.12,
24074            -0.20,   0.00,   0.00,  -0.12,  -0.20,  -0.12,  -0.20,   0.00,
24075             0.00,   0.12,  -0.20,   0.12,  -0.20,   0.12,   0.20,  -0.12,
24076            -0.20,   0.00,   0.00,   0.12,  -0.20,   0.12,  -0.20,   0.12,
24077             0.20,   0.12,   0.00,   0.20,  -0.12,  -0.20,   0.00,   0.00,
24078             0.12,   0.20,  -0.16,   0.00,   0.16,  -0.20,   0.20,   0.00,
24079             0.00,  -0.20,   0.00,   0.00,  -0.20,   0.20,   0.00,   0.00,
24080             0.20,   0.20,  -0.20,   0.00,   0.00,  -0.20,   0.12,   0.00,
24081            -0.16,   0.20,   0.00,   0.00,   0.20,   0.12,  -0.10,   0.00,
24082             0.10,   0.16,  -0.16,  -0.16,  -0.16,  -0.16,  -0.16,   0.00,
24083             0.00,  -0.16,   0.00,   0.00,  -0.16,  -0.16,  -0.16,   0.00,
24084             0.00,  -0.16,   0.00,   0.00,   0.16,   0.00,   0.00,   0.16,
24085 
24086        /* 4564-4691 */
24087             0.00,   0.00,   0.16,   0.16,   0.00,   0.00,  -0.16,   0.00,
24088             0.00,  -0.16,  -0.16,   0.00,   0.00,   0.16,   0.00,   0.00,
24089            -0.16,  -0.16,   0.00,   0.00,  -0.16,  -0.16,   0.12,   0.10,
24090             0.12,  -0.10,   0.12,   0.10,   0.00,   0.00,   0.12,   0.10,
24091            -0.12,   0.10,   0.00,   0.00,   0.12,   0.10,   0.12,  -0.10,
24092             0.00,   0.00,  -0.12,  -0.10,   0.00,   0.00,   0.12,   0.10,
24093             0.12,   0.00,   0.00,   0.12,   0.00,   0.00,  -0.12,   0.00,
24094             0.00,   0.12,   0.12,   0.12,   0.12,   0.12,   0.00,   0.00,
24095             0.12,   0.00,   0.00,   0.12,   0.12,   0.00,   0.00,   0.12,
24096             0.00,   0.00,   0.12,  -0.12,  -0.12,   0.12,   0.12,  -0.12,
24097            -0.12,   0.00,   0.00,   0.12,  -0.12,   0.12,   0.12,  -0.12,
24098            -0.12,   0.00,   0.00,  -0.12,  -0.12,   0.00,   0.00,  -0.12,
24099             0.12,   0.00,   0.00,   0.12,   0.00,   0.00,   0.12,   0.00,
24100             0.00,   0.12,  -0.12,   0.00,   0.00,  -0.12,   0.12,  -0.12,
24101            -0.12,   0.12,   0.00,   0.00,   0.12,   0.12,   0.12,  -0.12,
24102             0.00,   0.00,  -0.12,  -0.12,  -0.12,   0.00,   0.00,  -0.12,
24103 
24104        /* 4692-NA */
24105            -0.12,   0.00,   0.00,   0.12,   0.12,   0.00,   0.00,  -0.12,
24106            -0.12,  -0.12,  -0.12,   0.12,   0.00,   0.00,   0.12,  -0.12,
24107             0.00,   0.00,  -0.12,  -0.12,   0.00,   0.00,   0.12,  -0.12,
24108            -0.12,  -0.12,  -0.12,   0.12,   0.12,  -0.12,  -0.12,   0.00,
24109             0.00,  -0.12,   0.00,   0.00,  -0.12,   0.12,   0.00,   0.00,
24110             0.12,   0.00,   0.00,  -0.12,  -0.12,   0.00,   0.00,  -0.12,
24111            -0.12,   0.12,   0.00,   0.00,   0.12,   0.12,   0.00,   0.00,
24112             0.12,   0.00,   0.00,   0.12,   0.12,   0.08,   0.00,   0.04
24113        };
24114 
24115     /* Number of amplitude coefficients */
24116         final int NA = a.length;
24117 
24118     /* Amplitude usage: X or Y, sin or cos, power of T. */
24119         final int jaxy[] = {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1};
24120         final int jasc[] = {0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0};
24121         final int japt[] = {0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4};
24122 
24123     /* Miscellaneous */
24124        double t, w, pt[] = new double[MAXPT+1], fa[] = new double[14], xypr[] = new double[2], xypl[] = new double[2], xyls[] = new double[2], arg,
24125               sc[] = new double[2];
24126        int jpt, i, j, jxy, ialast, ifreq, m, ia, jsc;
24127 
24128     /*--------------------------------------------------------------------*/
24129 
24130     /* Interval between fundamental date J2000.0 and given date (JC). */
24131        t = ((date1 - DJ00) + date2) / DJC;
24132 
24133     /* Powers of T. */
24134        w = 1.0;
24135        for (jpt = 0; jpt <= MAXPT; jpt++) {
24136           pt[jpt] = w;
24137           w *= t;
24138        }
24139 
24140     /* Initialize totals in X and Y:  polynomial, luni-solar, planetary. */
24141        for (jxy = 0; jxy < 2; jxy++) {
24142           xypr[jxy] = 0.0;
24143           xyls[jxy] = 0.0;
24144           xypl[jxy] = 0.0;
24145        }
24146 
24147     /* --------------------------------- */
24148     /* Fundamental arguments (IERS 2003) */
24149     /* --------------------------------- */
24150 
24151     /* Mean anomaly of the Moon. */
24152        fa[0] = jauFal03(t);
24153 
24154     /* Mean anomaly of the Sun. */
24155        fa[1] = jauFalp03(t);
24156 
24157     /* Mean argument of the latitude of the Moon. */
24158        fa[2] = jauFaf03(t);
24159 
24160     /* Mean elongation of the Moon from the Sun. */
24161        fa[3] = jauFad03(t);
24162 
24163     /* Mean longitude of the ascending node of the Moon. */
24164        fa[4] = jauFaom03(t);
24165 
24166     /* Planetary longitudes, Mercury through Neptune. */
24167        fa[5] = jauFame03(t);
24168        fa[6] = jauFave03(t);
24169        fa[7] = jauFae03(t);
24170        fa[8] = jauFama03(t);
24171        fa[9] = jauFaju03(t);
24172        fa[10] = jauFasa03(t);
24173        fa[11] = jauFaur03(t);
24174        fa[12] = jauFane03(t);
24175 
24176     /* General accumulated precession in longitude. */
24177        fa[13] = jauFapa03(t);
24178 
24179     /* -------------------------------------- */
24180     /* Polynomial part of precession-nutation */
24181     /* -------------------------------------- */
24182 
24183        for (jxy = 0; jxy < 2; jxy++) {
24184           for (j = MAXPT; j >= 0; j--) {
24185              xypr[jxy] += xyp[jxy][j] * pt[j];
24186           }
24187        }
24188 
24189     /* ---------------------------------- */
24190     /* Nutation periodic terms, planetary */
24191     /* ---------------------------------- */
24192 
24193     /* Work backwards through the coefficients per frequency list. */
24194        ialast = NA;
24195        for (ifreq = NFPL-1; ifreq >= 0; ifreq--) {
24196 
24197        /* Obtain the argument functions. */
24198           arg = 0.0;
24199           for (i = 0; i < 14; i++) {
24200              m = mfapl[ifreq][i];
24201              if (m != 0) arg += (double)m * fa[i];
24202           }
24203           sc[0] = sin(arg);
24204           sc[1] = cos(arg);
24205 
24206        /* Work backwards through the amplitudes at this frequency. */
24207           ia = nc[ifreq+NFLS];
24208           for (i = ialast; i >= ia; i--) {
24209 
24210           /* Coefficient number (0 = 1st). */
24211              j = i-ia;
24212 
24213           /* X or Y. */
24214              jxy = jaxy[j];
24215 
24216           /* Sin or cos. */
24217              jsc = jasc[j];
24218 
24219           /* Power of T. */
24220              jpt = japt[j];
24221 
24222           /* Accumulate the component. */
24223              xypl[jxy] += a[i-1] * sc[jsc] * pt[jpt];
24224           }
24225           ialast = ia-1;
24226        }
24227 
24228     /* ----------------------------------- */
24229     /* Nutation periodic terms, luni-solar */
24230     /* ----------------------------------- */
24231 
24232     /* Continue working backwards through the number of coefficients list. */
24233        for (ifreq = NFLS-1; ifreq >= 0; ifreq--) {
24234 
24235        /* Obtain the argument functions. */
24236           arg = 0.0;
24237           for (i = 0; i < 5; i++) {
24238              m = mfals[ifreq][i];
24239              if (m != 0) arg += (double)m * fa[i];
24240           }
24241           sc[0] = sin(arg);
24242           sc[1] = cos(arg);
24243 
24244        /* Work backwards through the amplitudes at this frequency. */
24245           ia = nc[ifreq];
24246           for (i = ialast; i >= ia; i--) {
24247 
24248           /* Coefficient number (0 = 1st). */
24249              j = i-ia;
24250 
24251           /* X or Y. */
24252              jxy = jaxy[j];
24253 
24254           /* Sin or cos. */
24255              jsc = jasc[j];
24256 
24257           /* Power of T. */
24258              jpt = japt[j];
24259 
24260           /* Accumulate the component. */
24261              xyls[jxy] += a[i-1] * sc[jsc] * pt[jpt];
24262           }
24263           ialast = ia-1;
24264        }
24265 
24266     /* ------------------------------------ */
24267     /* Results:  CIP unit vector components */
24268     /* ------------------------------------ */
24269 
24270        double x = DAS2R * (xypr[0] + (xyls[0] + xypl[0]) / 1e6);
24271        double y = DAS2R * (xypr[1] + (xyls[1] + xypl[1]) / 1e6);
24272 
24273        return new CelestialIntermediatePole(x, y);
24274 
24275         }
24276     
24277 
24278     /**
24279     *  For a given TT date, compute the X,Y coordinates of the Celestial
24280     *  Intermediate Pole and the CIO locator s, using the IAU 2000A
24281     *  precession-nutation model.
24282     *
24283     *<p>This function is derived from the International Astronomical Union's
24284     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24285     *
24286     *<p>Status:  support function.
24287     *
24288     *<!-- Given: -->
24289     *     @param date1 double TT as a 2-part Julian Date (Note 1)
24290     *     @param date2 double TT as a 2-part Julian Date (Note 1)
24291     *
24292     *<!-- Returned: -->
24293     *     @return x double     <u>returned</u> Celestial Intermediate Pole (Note 2)
24294     *             y double     <u>returned</u> Celestial Intermediate Pole (Note 2) 
24295     *             s double     <u>returned</u> the CIO locator s (Note 2)
24296     *
24297     * <p>Notes:
24298     * <ol>
24299     *
24300     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
24301     *     convenient way between the two arguments.  For example,
24302     *     JD(TT)=2450123.7 could be expressed in any of these ways,
24303     *     among others:
24304     *<pre>
24305     *            date1          date2
24306     *
24307     *         2450123.7           0.0       (JD method)
24308     *         2451545.0       -1421.3       (J2000 method)
24309     *         2400000.5       50123.2       (MJD method)
24310     *         2450123.5           0.2       (date &amp; time method)
24311     *</pre>
24312     *     The JD method is the most natural and convenient to use in
24313     *     cases where the loss of several decimal digits of resolution
24314     *     is acceptable.  The J2000 method is best matched to the way
24315     *     the argument is handled internally and will deliver the
24316     *     optimum resolution.  The MJD method and the date &amp; time methods
24317     *     are both good compromises between resolution and convenience.
24318     *
24319     * <li> The Celestial Intermediate Pole coordinates are the x,y
24320     *     components of the unit vector in the Geocentric Celestial
24321     *     Reference System.
24322     *
24323     * <li> The CIO locator s (in radians) positions the Celestial
24324     *     Intermediate Origin on the equator of the CIP.
24325     *
24326     * <li> A faster, but slightly less accurate, result (about 1 mas for
24327     *     X,Y), can be obtained by using instead the jauXys00b function.
24328     *</ol>
24329     *<p>Called:<ul>
24330     *     <li>{@link #jauPnm00a} classical NPB matrix, IAU 2000A
24331     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
24332     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
24333     * </ul>
24334     *<p>Reference:
24335     *
24336     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
24337     *     IERS Technical Note No. 32, BKG (2004)
24338     *
24339     *@version 2008 May 12
24340     *
24341     *  @since Release 20101201
24342     *
24343     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24344     */
24345     public static ICRFrame jauXys00a(double date1, double date2)
24346     {
24347 
24348     /* Form the bias-precession-nutation matrix, IAU 2000A. */
24349        double rbpn[][] = jauPnm00a(date1, date2);
24350 
24351     /* Extract X,Y. */
24352        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
24353 
24354     /* Obtain s. */
24355        double s = jauS00(date1, date2, cip.x, cip.y);
24356 
24357        return new ICRFrame(cip, s);
24358 
24359         }
24360     
24361 
24362     /**
24363      *    The Celestial Intermediate Pole coordinates are the x,y
24364     *     components of the unit vector in the Geocentric Celestial
24365     *     Reference System.
24366     *
24367     *  The CIO locator s (in radians) positions the Celestial
24368     *     Intermediate Origin on the equator of the CIP.
24369  
24370      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
24371      * 
24372      * @since AIDA Stage 1
24373      */
24374     public static class ICRFrame {
24375         public CelestialIntermediatePole cip;
24376         public double s;
24377         public ICRFrame(CelestialIntermediatePole cip, double s) {
24378             this.cip = cip;
24379             this.s = s;
24380         }
24381     }
24382     /**
24383     *  For a given TT date, compute the X,Y coordinates of the Celestial
24384     *  Intermediate Pole and the CIO locator s, using the IAU 2000B
24385     *  precession-nutation model.
24386     *
24387     *<p>This function is derived from the International Astronomical Union's
24388     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24389     *
24390     *<p>Status:  support function.
24391     *
24392     *<!-- Given: -->
24393     *     @param date1 double TT as a 2-part Julian Date (Note 1)
24394     *     @param date2 double TT as a 2-part Julian Date (Note 1)
24395     *
24396     *<!-- Returned: -->
24397     *     @return x double     <u>returned</u> Celestial Intermediate Pole (Note 2)
24398     *             y double     <u>returned</u> Celestial Intermediate Pole (Note 2) 
24399     *             s             double     <u>returned</u> the CIO locator s (Note 2)
24400     *
24401     * <p>Notes:
24402     * <ol>
24403     *
24404     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
24405     *     convenient way between the two arguments.  For example,
24406     *     JD(TT)=2450123.7 could be expressed in any of these ways,
24407     *     among others:
24408     *<pre>
24409     *            date1          date2
24410     *
24411     *         2450123.7           0.0       (JD method)
24412     *         2451545.0       -1421.3       (J2000 method)
24413     *         2400000.5       50123.2       (MJD method)
24414     *         2450123.5           0.2       (date &amp; time method)
24415     *</pre>
24416     *     The JD method is the most natural and convenient to use in
24417     *     cases where the loss of several decimal digits of resolution
24418     *     is acceptable.  The J2000 method is best matched to the way
24419     *     the argument is handled internally and will deliver the
24420     *     optimum resolution.  The MJD method and the date &amp; time methods
24421     *     are both good compromises between resolution and convenience.
24422     *
24423     * <li> The Celestial Intermediate Pole coordinates are the x,y
24424     *     components of the unit vector in the Geocentric Celestial
24425     *     Reference System.
24426     *
24427     * <li> The CIO locator s (in radians) positions the Celestial
24428     *     Intermediate Origin on the equator of the CIP.
24429     *
24430     * <li> The present function is faster, but slightly less accurate (about
24431     *     1 mas in X,Y), than the jauXys00a function.
24432     *</ol>
24433     *<p>Called:<ul>
24434     *     <li>{@link #jauPnm00b} classical NPB matrix, IAU 2000B
24435     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
24436     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
24437     * </ul>
24438     *<p>Reference:
24439     *
24440     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
24441     *     IERS Technical Note No. 32, BKG (2004)
24442     *
24443     *@version 2008 May 12
24444     *
24445     *  @since Release 20101201
24446     *
24447     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24448     */
24449     public static ICRFrame jauXys00b(double date1, double date2)
24450     {
24451        double rbpn[][] = new double[3][3];
24452 
24453 
24454     /* Form the bias-precession-nutation matrix, IAU 2000A. */
24455        rbpn = jauPnm00b(date1, date2);
24456 
24457     /* Extract X,Y. */
24458        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
24459 
24460     /* Obtain s. */
24461        double s = jauS00(date1, date2, cip.x, cip.y);
24462 
24463        return new ICRFrame(cip, s);
24464 
24465         }
24466     
24467 
24468     /**
24469     *  For a given TT date, compute the X,Y coordinates of the Celestial
24470     *  Intermediate Pole and the CIO locator s, using the IAU 2006
24471     *  precession and IAU 2000A nutation models.
24472     *
24473     *<p>This function is derived from the International Astronomical Union's
24474     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24475     *
24476     *<p>Status:  support function.
24477     *
24478     *<!-- Given: -->
24479     *     @param date1 double TT as a 2-part Julian Date (Note 1)
24480     *     @param date2 double TT as a 2-part Julian Date (Note 1)
24481     *
24482     *<!-- Returned: -->
24483     *     @return x double    <u>returned</u> Celestial Intermediate Pole (Note 2)
24484     *             y double    <u>returned</u> Celestial Intermediate Pole (Note 2) 
24485     *             s             double    <u>returned</u> the CIO locator s (Note 2)
24486     *
24487     * <p>Notes:
24488     * <ol>
24489     *
24490     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
24491     *     convenient way between the two arguments.  For example,
24492     *     JD(TT)=2450123.7 could be expressed in any of these ways,
24493     *     among others:
24494     *<pre>
24495     *            date1          date2
24496     *
24497     *         2450123.7           0.0       (JD method)
24498     *         2451545.0       -1421.3       (J2000 method)
24499     *         2400000.5       50123.2       (MJD method)
24500     *         2450123.5           0.2       (date &amp; time method)
24501     *</pre>
24502     *     The JD method is the most natural and convenient to use in
24503     *     cases where the loss of several decimal digits of resolution
24504     *     is acceptable.  The J2000 method is best matched to the way
24505     *     the argument is handled internally and will deliver the
24506     *     optimum resolution.  The MJD method and the date &amp; time methods
24507     *     are both good compromises between resolution and convenience.
24508     *
24509     * <li> The Celestial Intermediate Pole coordinates are the x,y components
24510     *     of the unit vector in the Geocentric Celestial Reference System.
24511     *
24512     * <li> The CIO locator s (in radians) positions the Celestial
24513     *     Intermediate Origin on the equator of the CIP.
24514     *
24515     * <li> Series-based solutions for generating X and Y are also available:
24516     *     see Capitaine &amp; Wallace (2006) and jauXy06.
24517     *</ol>
24518     *<p>Called:<ul>
24519     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
24520     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
24521     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
24522     * </ul>
24523     *<p>References:
24524     *
24525     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
24526     *
24527     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
24528     *
24529     *@version 2008 May 11
24530     *
24531     *  @since Release 20101201
24532     *
24533     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24534     */
24535     public static ICRFrame jauXys06a(double date1, double date2)
24536     {
24537        double rbpn[][] = new double[3][3];
24538 
24539 
24540     /* Form the bias-precession-nutation matrix, IAU 2000A. */
24541        rbpn = jauPnm06a(date1, date2);
24542 
24543     /* Extract X,Y. */
24544        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
24545 
24546     /* Obtain s. */
24547        double s = jauS06(date1, date2, cip.x, cip.y);
24548 
24549        return new ICRFrame(cip, s);
24550 
24551         }
24552     
24553 
24554     /**
24555     *  Zero a p-vector.
24556     *
24557     *<p>This function is derived from the International Astronomical Union's
24558     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24559     *
24560     *<p>Status:  vector/matrix support function.
24561     *
24562     *<!-- Returned: -->
24563     *     @param p         double[3]        <u>returned</u> p-vector
24564     *
24565     *@version 2008 May 11
24566     *
24567     *  @since Release 20101201
24568     *
24569     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24570     */
24571     public static void jauZp(double p[] )
24572     {
24573        p[0] = 0.0;
24574        p[1] = 0.0;
24575        p[2] = 0.0;
24576 
24577        return;
24578 
24579     }
24580     /**
24581      * Return Zero p-vector. This is a convenience method that is an 
24582      * overload of the official SOFA API {@link #jauZp(double[])} that does not require 
24583      * the vector to be passed in.
24584      * 
24585      * @return double[3] a zero vector.
24586      *
24587      */
24588     public static double[] jauZp()
24589     {
24590         double p[] = new double[3];
24591         jauZp(p);
24592         return p;
24593     }
24594 
24595     /**
24596     *  Zero a pv-vector.
24597     *
24598     *<p>This function is derived from the International Astronomical Union's
24599     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24600     *
24601     *<p>Status:  vector/matrix support function.
24602     *
24603     *<!-- Returned: -->
24604     *     @param pv        double[2][3]        <u>returned</u> pv-vector
24605     *
24606     *<p>Called:<ul>
24607     *     <li>{@link #jauZp} zero p-vector
24608     * </ul>
24609     *@version 2008 May 11
24610     *
24611     *  @since Release 20101201
24612     *
24613     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24614     */
24615     public static void jauZpv(double pv[][])
24616     {
24617        jauZp(pv[0]);
24618        jauZp(pv[1]);
24619 
24620        return;
24621 
24622         }
24623     
24624     /**
24625      *  A Zero pv-vector.
24626      *  
24627      * This is a convenience method that is an 
24628      * overload of the official SOFA API {@link #jauZpv(double[][])} that does not require 
24629      * the vector to be passed in.
24630      *  
24631      * @return pv    double[2][3]  pv-vector
24632      */
24633     public static double[][] jauZpv() {
24634         double pv[][] = new double[2][3];
24635         jauZpv(pv);
24636         return pv;
24637     }
24638 
24639     
24640 
24641     /**
24642     *  Initialize an r-matrix to the null matrix.
24643     *
24644     *<p>This function is derived from the International Astronomical Union's
24645     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24646     *
24647     *<p>Status:  vector/matrix support function.
24648     *
24649     *<!-- Returned: -->
24650     *     @param r         double[3][3]      <u>returned</u> r-matrix
24651     *
24652     *@version 2008 May 11
24653     *
24654     *  @since Release 20101201 
24655     *
24656     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24657     */
24658     public static void jauZr(double r[][])
24659     {
24660        int i, j;
24661 
24662 
24663        for (i = 0; i < 3; i++) {
24664           for (j = 0; j < 3; j++) {
24665              r[i][j] = 0.0;
24666           }
24667        }
24668 
24669        return;
24670 
24671      }
24672      /**
24673       * Initialize an r-matrix to the null matrix. 
24674       * 
24675       * This is a convenience method that is an 
24676      * overload of the official SOFA API {@link #jauZr(double[][])} that does not require 
24677      * the vector to be passed in.
24678      * @return null r matrix.
24679      */
24680     public static double[][] jauZr()
24681      {
24682          double r[][] = new double[2][3];
24683          jauZr(r);
24684          return r;
24685      }
24686    
24687 
24688     /**
24689      * returns the first argument modulo the second.
24690      * Utility function to retain C use of fmod.
24691      * @param d
24692      * @param d2
24693      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 27 Jan 2010
24694      * @return
24695      */
24696     private static double fmod(double d, double d2) {
24697         return d % d2;
24698     }
24699  //IMPL new 20131202 routines after here
24700 
24701     /**
24702      *  Star-independent astrometry parameters.
24703      * 
24704      *  (Vectors eb, eh, em and v are all with respect to BCRS axes.)
24705      *  
24706      *  @author Paul Harrison (paul.harrison@manchester.ac.uk) 26 Mar 2014
24707      *  @since 20131202
24708      */
24709     public static class  Astrom {
24710         
24711 /** PM time interval (SSB, Julian years) */
24712        public double pmt;       
24713 /** SSB to observer (vector, au) [3]*/
24714        public double eb[] = new double[3];      
24715 /** Sun to observer (unit vector)[3] */
24716        public double eh[] = new double[3];      
24717 /** distance from Sun to observer (au) */
24718        public double em;         
24719 /** barycentric observer velocity (vector, c)[3] */
24720        public double v[] = new double[3];       
24721 /** sqrt(1-|v|^2): reciprocal of Lorenz factor */
24722        public double bm1;        
24723 /** bias-precession-nutation matrix [3][3] */
24724        public double bpn[][] = new double[3][3];  
24725 /** adjusted longitude  (radians) */
24726        public double along;      
24727 /** geodetic latitude (radians) */
24728        public double phi;        
24729 /** polar motion xp wrt local meridian (radians) */
24730        public double xpl;        
24731 /** polar motion yp wrt local meridian (radians) */
24732        public double ypl;        
24733 /** sine of geodetic latitude */
24734        public double sphi;       
24735 /** cosine of geodetic latitude */
24736        public double cphi;       
24737 /** magnitude of diurnal aberration vector */
24738        public double diurab;     
24739 /** "local" Earth rotation angle (radians) */
24740        public double eral;       
24741 /** refraction constant A (radians) */
24742        public double refa;       
24743 /** refraction constant B (radians) */
24744        public double refb;       
24745        
24746        /**
24747         * 
24748         */
24749        public Astrom(){}
24750     } ;
24751 
24752     /**
24753      *  Body parameters for light deflection.
24754      *  @author Paul Harrison (paul.harrison@manchester.ac.uk) 26 Mar 2014
24755      *  @since 20131202
24756      */
24757     public static class Ldbody {
24758         /** mass of the body (solar masses) */
24759        public double bm;
24760        /** deflection limiter (radians^2/2) */
24761        public double dl; 
24762        /** barycentric PV of the body (au, au/day)[2][3] */
24763        public double pv[][] = new double [2][3];   
24764     } ;
24765 
24766 
24767     /**
24768      *  Apply aberration to transform natural direction into proper
24769      *  direction.
24770      *
24771      *<p>This function is derived from the International Astronomical Union's
24772      *  SOFA (Standards of Fundamental Astronomy) software collection.
24773      *
24774      *<p>Status:  support function.
24775      *
24776      *<!-- Given: -->
24777      *    @param pnat     double[3]    natural direction to the source (unit vector)
24778      *    @param v        double[3]    observer barycentric velocity in units of c
24779      *    @param s        double       distance between the Sun and the observer (au)
24780      *    @param bm1      double       sqrt(1-|v|^2): reciprocal of Lorenz factor
24781      *
24782      *<!-- Returned:-->
24783      *    @return ppr      double[3]     <b>Returned</b> proper direction to source (unit vector)
24784      *
24785      *<p>Notes:
24786      * <ol>
24787      *
24788      *  <li> The algorithm is based on Expr. (7.40) in the Explanatory
24789      *     Supplement (Urban &amp; Seidelmann 2013), but with the following
24790      *     changes:
24791      *
24792      *     <p>o  Rigorous rather than approximate normalization is applied.
24793      *
24794      *     <p>o  The gravitational potential term from Expr. (7) in
24795      *        Klioner (2003) is added, taking into account only the Sun's
24796      *        contribution.  This has a maximum effect of about
24797      *        0.4 microarcsecond.
24798      *
24799      *  <li> In almost all cases, the maximum accuracy will be limited by the
24800      *     supplied velocity.  For example, if the SOFA iauEpv00 function is
24801      *     used, errors of up to 5 microarcseconds could occur.
24802      *
24803      * </ol>
24804      *<p>References:
24805      * <ul>
24806      *
24807      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
24808      *     the Astronomical Almanac, 3rd ed., University Science Books
24809      *     (2013).
24810      *
24811      * <li> Klioner, Sergei A., "A practical relativistic model for micro-
24812      *     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
24813      *
24814      * </ul>
24815      *  Called:
24816      * <ul>
24817      *     <li>{@link #jauPdp} scalar product of two p-vectors
24818      *
24819      * </ul>
24820      *@version  2013 October 9
24821      *
24822      *@since JSOFA release 20131202
24823      *
24824      *
24825      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
24826      */
24827     public static  double[] jauAb(double pnat[], double v[], double s, double bm1
24828            )
24829     {
24830         int i;
24831         double pdv, w1, w2, r2, w, p[] = new double[3], r;
24832         double ppr[] = new double[3];
24833 
24834         pdv = jauPdp(pnat, v);
24835         w1 = 1.0 + pdv/(1.0 + bm1);
24836         w2 = SRS/s;
24837         r2 = 0.0;
24838         for (i = 0; i < 3; i++) {
24839             w = pnat[i]*bm1 + w1*v[i] + w2*(v[i] - pdv*pnat[i]);
24840             p[i] = w;
24841             r2 = r2 + w*w;
24842         }
24843         r = sqrt(r2);
24844         for (i = 0; i < 3; i++) {
24845             ppr[i] = p[i]/r;
24846         }
24847         return ppr;
24848         /* Finished. */
24849 
24850 
24851     }
24852 
24853     /**
24854      *  For a geocentric observer, prepare star-independent astrometry
24855      *  parameters for transformations between ICRS and GCRS coordinates.
24856      *  The Earth ephemeris is supplied by the caller.
24857      *
24858      *  The parameters produced by this function are required in the
24859      *  parallax, light deflection and aberration parts of the astrometric
24860      *  transformation chain.
24861      *
24862      *<p>This function is derived from the International Astronomical Union's
24863      *  SOFA (Standards of Fundamental Astronomy) software collection.
24864      *
24865      *<p>Status:  support function.
24866      *
24867      *<!-- Given: -->
24868      *     @param date1   double        TDB as a 2-part...
24869      *     @param date2   double        ...Julian Date (Note 1)
24870      *     @param ebpv    double[2][3]  Earth barycentric pos/vel (au, au/day)
24871      *     @param ehp     double[3]     Earth heliocentric position (au)
24872      *
24873      *<!-- Returned:-->
24874      *     @param astrom  jauASTROM     <b>Returned</b> star-independent astrometry parameters:
24875      *
24876      *<p>Notes:
24877      * <ol>
24878      *
24879      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
24880      *     convenient way between the two arguments.  For example,
24881      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
24882      *     others:
24883      *     <pre>
24884      *           date1          date2
24885      *
24886      *         2450123.7           0.0       (JD method)
24887      *         2451545.0       -1421.3       (J2000 method)
24888      *         2400000.5       50123.2       (MJD method)
24889      *         2450123.5           0.2       (date &amp; time method)
24890      *     </pre>
24891      *     <p>The JD method is the most natural and convenient to use in cases
24892      *     where the loss of several decimal digits of resolution is
24893      *     acceptable.  The J2000 method is best matched to the way the
24894      *     argument is handled internally and will deliver the optimum
24895      *     resolution.  The MJD method and the date &amp; time methods are both
24896      *     good compromises between resolution and convenience.  For most
24897      *     applications of this function the choice will not be at all
24898      *     critical.
24899      *
24900      *     <p>TT can be used instead of TDB without any significant impact on
24901      *     accuracy.
24902      *
24903      *  <li> All the vectors are with respect to BCRS axes.
24904      *
24905      *  <li> This is one of several functions that inserts into the astrom
24906      *     structure star-independent parameters needed for the chain of
24907      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed}.
24908      *
24909      *     <p>The various functions support different classes of observer and
24910      *     portions of the transformation chain:
24911      *     <pre>{@code
24912      *          functions         observer        transformation
24913      *
24914      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
24915      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
24916      *       iauApco iauApco13    terrestrial     ICRS <-> observed
24917      *       iauApcs iauApcs13    space           ICRS <-> GCRS
24918      *       iauAper iauAper13    terrestrial     update Earth rotation
24919      *       iauApio iauApio13    terrestrial     CIRS <-> observed
24920      *     }</pre>
24921      *     
24922      *     <p>Those with names ending in "13" use contemporary SOFA models to
24923      *     compute the various ephemerides.  The others accept ephemerides
24924      *     supplied by the caller.
24925      *
24926      *     <p>The transformation from ICRS to GCRS covers space motion,
24927      *     parallax, light deflection, and aberration.  From GCRS to CIRS
24928      *     comprises frame bias and precession-nutation.  From CIRS to
24929      *     observed takes account of Earth rotation, polar motion, diurnal
24930      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
24931      *     transformation), and atmospheric refraction.
24932      *
24933      *  <li> The context structure astrom produced by this function is used by
24934      *     iauAtciq* and iauAticq*.
24935      *
24936      * </ol>
24937      *  Called:
24938      * <ul>
24939      *     <li>{@link #jauApcs} astrometry parameters, ICRS-GCRS, space observer
24940      *
24941      * </ul>
24942      *@version  2013 October 9
24943      *
24944      *@since JSOFA release 20131202
24945      *
24946      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
24947      */
24948     public static void jauApcg(double date1, double date2,
24949             double ebpv[][], double ehp[],
24950             Astrom astrom)
24951     {
24952         /* Geocentric observer */
24953         double pv[][] = { { 0.0, 0.0, 0.0 },
24954             { 0.0, 0.0, 0.0 } };
24955 
24956 
24957             /* Compute the star-independent astrometry parameters. */
24958             jauApcs(date1, date2, pv, ebpv, ehp, astrom);
24959 
24960             /* Finished. */
24961 
24962 
24963     }
24964 
24965     /**
24966      *  For a geocentric observer, prepare star-independent astrometry
24967      *  parameters for transformations between ICRS and GCRS coordinates.
24968      *  The caller supplies the date, and SOFA models are used to predict
24969      *  the Earth ephemeris.
24970      *
24971      *  The parameters produced by this function are required in the
24972      *  parallax, light deflection and aberration parts of the astrometric
24973      *  transformation chain.
24974      *
24975      *<p>This function is derived from the International Astronomical Union's
24976      *  SOFA (Standards of Fundamental Astronomy) software collection.
24977      *
24978      *<p>Status:  support function.
24979      *
24980      *<!-- Given: -->
24981      *     @param date1   double      TDB as a 2-part...
24982      *     @param date2   double      ...Julian Date (Note 1)
24983      *
24984      *<!-- Returned:-->
24985      *     @param astrom     <b>Returned</b> star-independent astrometry parameters:
24986      *
24987      *<p>Notes:
24988      * <ol>
24989      *
24990      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
24991      *     convenient way between the two arguments.  For example,
24992      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
24993      *     others:
24994      *     <pre>
24995      *            date1          date2
24996      *
24997      *         2450123.7           0.0       (JD method)
24998      *         2451545.0       -1421.3       (J2000 method)
24999      *         2400000.5       50123.2       (MJD method)
25000      *         2450123.5           0.2       (date &amp; time method)
25001      *     </pre>
25002      *     <p>The JD method is the most natural and convenient to use in cases
25003      *     where the loss of several decimal digits of resolution is
25004      *     acceptable.  The J2000 method is best matched to the way the
25005      *     argument is handled internally and will deliver the optimum
25006      *     resolution.  The MJD method and the date &amp; time methods are both
25007      *     good compromises between resolution and convenience.  For most
25008      *     applications of this function the choice will not be at all
25009      *     critical.
25010      *
25011      *     <p>TT can be used instead of TDB without any significant impact on
25012      *     accuracy.
25013      *
25014      *  <li> All the vectors are with respect to BCRS axes.
25015      *
25016      *  <li> In cases where the caller wishes to supply his own Earth
25017      *     ephemeris, the function iauApcg can be used instead of the present
25018      *     function.
25019      *
25020      *  <li> This is one of several functions that inserts into the astrom
25021      *     structure star-independent parameters needed for the chain of
25022      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed}.
25023      *
25024      *     <p>The various functions support different classes of observer and
25025      *     portions of the transformation chain:
25026      *     <pre>
25027      *     {@code
25028      *          functions         observer        transformation
25029      *
25030      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25031      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25032      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25033      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25034      *       iauAper iauAper13    terrestrial     update Earth rotation
25035      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25036      *     }
25037      *     </pre>
25038      *     <p>Those with names ending in "13" use contemporary SOFA models to
25039      *     compute the various ephemerides.  The others accept ephemerides
25040      *     supplied by the caller.
25041      *
25042      *     <p>The transformation from ICRS to GCRS covers space motion,
25043      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25044      *     comprises frame bias and precession-nutation.  From CIRS to
25045      *     observed takes account of Earth rotation, polar motion, diurnal
25046      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25047      *     transformation), and atmospheric refraction.
25048      *
25049      *  <li> The context structure astrom produced by this function is used by
25050      *     iauAtciq* and iauAticq*.
25051      *
25052      * </ol>
25053      *  Called:
25054      * <ul>
25055      *     <li>{@link #jauEpv00} Earth position and velocity
25056      *     <li>{@link #jauApcg} astrometry parameters, ICRS-GCRS, geocenter
25057      *
25058      * </ul>
25059      *@version  2013 October 9
25060      *
25061      *@since JSOFA release 20131202
25062      *
25063      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25064      */
25065     public static void jauApcg13(double date1, double date2, Astrom astrom)
25066     {
25067         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3];
25068 
25069 
25070         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
25071         jauEpv00(date1, date2, ehpv, ebpv);
25072 
25073         /* Compute the star-independent astrometry parameters. */
25074         jauApcg(date1, date2, ebpv, ehpv[0], astrom);
25075 
25076         /* Finished. */
25077 
25078 
25079     }
25080 
25081     /**
25082      *  For a terrestrial observer, prepare star-independent astrometry
25083      *  parameters for transformations between ICRS and geocentric CIRS
25084      *  coordinates.  The Earth ephemeris and CIP/CIO are supplied by the
25085      *  caller.
25086      *
25087      *  The parameters produced by this function are required in the
25088      *  parallax, light deflection, aberration, and bias-precession-nutation
25089      *  parts of the astrometric transformation chain.
25090      *
25091      *<p>This function is derived from the International Astronomical Union's
25092      *  SOFA (Standards of Fundamental Astronomy) software collection.
25093      *
25094      *<p>Status:  support function.
25095      *
25096      *<!-- Given: -->
25097      *     @param date1   double        TDB as a 2-part...
25098      *     @param date2   double        ...Julian Date (Note 1)
25099      *     @param ebpv    double[2][3]  Earth barycentric position/velocity (au, au/day)
25100      *     @param ehp     double[3]     Earth heliocentric position (au)
25101      *     @param x double        CIP X,Y (components of unit vector)
25102      *     @param y double        CIP X,Y (components of unit vector) 
25103      *     @param s       double        the CIO locator s (radians)
25104      *
25105      *<!-- Returned:-->
25106      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
25107      *
25108      *<p>Notes:
25109      * <ol>
25110      *
25111      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25112      *     convenient way between the two arguments.  For example,
25113      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25114      *     others:
25115      *     <pre>
25116      *            date1          date2
25117      *
25118      *         2450123.7           0.0       (JD method)
25119      *         2451545.0       -1421.3       (J2000 method)
25120      *         2400000.5       50123.2       (MJD method)
25121      *         2450123.5           0.2       (date &amp; time method)
25122      *     </pre>
25123      *     <p>The JD method is the most natural and convenient to use in cases
25124      *     where the loss of several decimal digits of resolution is
25125      *     acceptable.  The J2000 method is best matched to the way the
25126      *     argument is handled internally and will deliver the optimum
25127      *     resolution.  The MJD method and the date &amp; time methods are both
25128      *     good compromises between resolution and convenience.  For most
25129      *     applications of this function the choice will not be at all
25130      *     critical.
25131      *
25132      *     <p>TT can be used instead of TDB without any significant impact on
25133      *     accuracy.
25134      *
25135      *  <li> All the vectors are with respect to BCRS axes.
25136      *
25137      *  <li> In cases where the caller does not wish to provide the Earth
25138      *     ephemeris and CIP/CIO, the function iauApci13 can be used instead
25139      *     of the present function.  This computes the required quantities
25140      *     using other SOFA functions.
25141      *
25142      *  <li> This is one of several functions that inserts into the astrom
25143      *     structure star-independent parameters needed for the chain of
25144      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25145      *
25146      *     <p>The various functions support different classes of observer and
25147      *     portions of the transformation chain:
25148      *     <pre>{@code
25149      *          functions         observer        transformation
25150      *
25151      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25152      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25153      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25154      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25155      *       iauAper iauAper13    terrestrial     update Earth rotation
25156      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25157      *     }</pre>
25158      *     <p>Those with names ending in "13" use contemporary SOFA models to
25159      *     compute the various ephemerides.  The others accept ephemerides
25160      *     supplied by the caller.
25161      *
25162      *     <p>The transformation from ICRS to GCRS covers space motion,
25163      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25164      *     comprises frame bias and precession-nutation.  From CIRS to
25165      *     observed takes account of Earth rotation, polar motion, diurnal
25166      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25167      *     transformation), and atmospheric refraction.
25168      *
25169      *  <li> The context structure astrom produced by this function is used by
25170      *     iauAtciq* and iauAticq*.
25171      *
25172      * </ol>
25173      *  Called:
25174      * <ul>
25175      *     <li>{@link #jauApcg} astrometry parameters, ICRS-GCRS, geocenter
25176      *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, given X,Y and s
25177      *
25178      * </ul>
25179      *@version  2013 September 25
25180      *
25181      *@since JSOFA release 20131202
25182      *
25183      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25184      */
25185     public static void jauApci(double date1, double date2,
25186             double ebpv[][], double ehp[],
25187             double x, double y, double s,
25188             Astrom astrom)
25189     {
25190 
25191         /* Star-independent astrometry parameters for geocenter. */
25192         jauApcg(date1, date2, ebpv, ehp, astrom);
25193 
25194         /* CIO based BPN matrix. */
25195         astrom.bpn = jauC2ixys(x, y, s);
25196 
25197         /* Finished. */
25198 
25199 
25200     }
25201 
25202     /**
25203      *  For a terrestrial observer, prepare star-independent astrometry
25204      *  parameters for transformations between ICRS and geocentric CIRS
25205      *  coordinates.  The caller supplies the date, and SOFA models are used
25206      *  to predict the Earth ephemeris and CIP/CIO.
25207      *
25208      *  The parameters produced by this function are required in the
25209      *  parallax, light deflection, aberration, and bias-precession-nutation
25210      *  parts of the astrometric transformation chain.
25211      *
25212      *<p>This function is derived from the International Astronomical Union's
25213      *  SOFA (Standards of Fundamental Astronomy) software collection.
25214      *
25215      *<p>Status:  support function.
25216      *
25217      *<!-- Given: -->
25218      *     @param date1   double       TDB as a 2-part...
25219      *     @param date2   double       ...Julian Date (Note 1)
25220      *     
25221      *<!-- Returned:-->
25222      *     @param astrom  jauASTROM    <b>Returned</b> star-independent astrometry parameters:
25223      *                    pmt     double         <b>Returned</b> PM time interval (SSB, Julian years)
25224      *                    eb      double[3]      <b>Returned</b> SSB to observer (vector, au)
25225      *                    eh      double[3]      <b>Returned</b> Sun to observer (unit vector)
25226      *                    em      double         <b>Returned</b> distance from Sun to observer (au)
25227      *                    v       double[3]      <b>Returned</b> barycentric observer velocity (vector, c)
25228      *                    bm1     double         <b>Returned</b> sqrt(1-|v|^2): reciprocal of Lorenz factor
25229      *                    bpn     double[3][3]   <b>Returned</b> bias-precession-nutation matrix
25230      *                    along   double         <b>Returned</b> unchanged
25231      *                    xpl     double         <b>Returned</b> unchanged
25232      *                    ypl     double         <b>Returned</b> unchanged
25233      *                    sphi    double         <b>Returned</b> unchanged
25234      *                    cphi    double         <b>Returned</b> unchanged
25235      *                    diurab  double         <b>Returned</b> unchanged
25236      *                    eral    double         <b>Returned</b> unchanged
25237      *                    refa    double         <b>Returned</b> unchanged
25238      *                    refb    double         <b>Returned</b> unchanged
25239      *     @return       double*       <b>Returned</b> equation of the origins (ERA-GST)
25240      *
25241      *<p>Notes:
25242      * <ol>
25243      *
25244      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25245      *     convenient way between the two arguments.  For example,
25246      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25247      *     others:
25248      *     <pre>
25249      *            date1          date2
25250      *
25251      *         2450123.7           0.0       (JD method)
25252      *         2451545.0       -1421.3       (J2000 method)
25253      *         2400000.5       50123.2       (MJD method)
25254      *         2450123.5           0.2       (date &amp; time method)
25255      *     </pre>
25256      *     <p>The JD method is the most natural and convenient to use in cases
25257      *     where the loss of several decimal digits of resolution is
25258      *     acceptable.  The J2000 method is best matched to the way the
25259      *     argument is handled internally and will deliver the optimum
25260      *     resolution.  The MJD method and the date &amp; time methods are both
25261      *     good compromises between resolution and convenience.  For most
25262      *     applications of this function the choice will not be at all
25263      *     critical.
25264      *
25265      *     <p>TT can be used instead of TDB without any significant impact on
25266      *     accuracy.
25267      *
25268      *  <li> All the vectors are with respect to BCRS axes.
25269      *
25270      *  <li> In cases where the caller wishes to supply his own Earth
25271      *     ephemeris and CIP/CIO, the function iauApci can be used instead
25272      *     of the present function.
25273      *
25274      *  <li> This is one of several functions that inserts into the astrom
25275      *     structure star-independent parameters needed for the chain of
25276      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25277      *
25278      *     <p>The various functions support different classes of observer and
25279      *     portions of the transformation chain:
25280      *     <pre>{@code
25281      *          functions         observer        transformation
25282      *
25283      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25284      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25285      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25286      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25287      *       iauAper iauAper13    terrestrial     update Earth rotation
25288      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25289      *     }</pre>
25290      *     <p>Those with names ending in "13" use contemporary SOFA models to
25291      *     compute the various ephemerides.  The others accept ephemerides
25292      *     supplied by the caller.
25293      *
25294      *     <p>The transformation from ICRS to GCRS covers space motion,
25295      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25296      *     comprises frame bias and precession-nutation.  From CIRS to
25297      *     observed takes account of Earth rotation, polar motion, diurnal
25298      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25299      *     transformation), and atmospheric refraction.
25300      *
25301      *  <li> The context structure astrom produced by this function is used by
25302      *     iauAtciq* and iauAticq*.
25303      *
25304      * </ol>
25305      *  Called:
25306      * <ul>
25307      *     <li>{@link #jauEpv00} Earth position and velocity
25308      *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
25309      *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
25310      *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
25311      *     <li>{@link #jauApci} astrometry parameters, ICRS-CIRS
25312      *     <li>{@link #jauEors} equation of the origins, given NPB matrix and s
25313      *
25314      * </ul>
25315      *@version  2013 October 9
25316      *
25317      *@since JSOFA release 20131202
25318      *
25319      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25320      */
25321     public static double jauApci13(double date1, double date2,
25322             Astrom astrom)
25323     {
25324         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3], r[][], s;
25325 
25326 
25327         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
25328         jauEpv00(date1, date2, ehpv, ebpv);
25329 
25330         /* Form the equinox based BPN matrix, IAU 2006/2000A. */
25331         r = jauPnm06a(date1, date2);
25332 
25333         /* Extract CIP X,Y. */
25334         CelestialIntermediatePole cip = jauBpn2xy(r);
25335 
25336         /* Obtain CIO locator s. */
25337         s = jauS06(date1, date2, cip.x, cip.y);
25338 
25339         /* Compute the star-independent astrometry parameters. */
25340         jauApci(date1, date2, ebpv, ehpv[0], cip.x, cip.y, s, astrom);
25341 
25342         /* Equation of the origins. */
25343         return jauEors(r, s);
25344 
25345         /* Finished. */
25346 
25347 
25348     }
25349 
25350     /**
25351      *  For a terrestrial observer, prepare star-independent astrometry
25352      *  parameters for transformations between ICRS and observed
25353      *  coordinates.  The caller supplies the Earth ephemeris, the Earth
25354      *  rotation information and the refraction constants as well as the
25355      *  site coordinates.
25356      *
25357      *<p>This function is derived from the International Astronomical Union's
25358      *  SOFA (Standards of Fundamental Astronomy) software collection.
25359      *
25360      *<p>Status:  support function.
25361      *
25362      *<!-- Given: -->
25363      *     @param date1   double        TDB as a 2-part...
25364      *     @param date2   double        ...Julian Date (Note 1)
25365      *     @param ebpv    double[2][3]  Earth barycentric PV (au, au/day, Note 2)
25366      *     @param ehp     double[3]     Earth heliocentric P (au, Note 2)
25367      *     @param x double        CIP X,Y (components of unit vector)
25368      *     @param y double        CIP X,Y (components of unit vector) 
25369      *     @param s       double        the CIO locator s (radians)
25370      *     @param theta   double        Earth rotation angle (radians)
25371      *     @param elong   double        longitude (radians, east +ve, Note 3)
25372      *     @param phi     double        latitude (geodetic, radians, Note 3)
25373      *     @param hm      double        height above ellipsoid (m, geodetic, Note 3)
25374      *     @param xp double        polar motion coordinates (radians, Note 4)
25375      *     @param yp double        polar motion coordinates (radians, Note 4) 
25376      *     @param sp      double        the TIO locator s' (radians, Note 4)
25377      *     @param refa    double        refraction constant A (radians, Note 5)
25378      *     @param refb    double        refraction constant B (radians, Note 5)
25379      *
25380      *<!-- Returned:-->
25381      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
25382      *
25383      *<p>Notes:
25384      * <ol>
25385      *
25386      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25387      *     convenient way between the two arguments.  For example,
25388      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25389      *     others:
25390      *     <pre>
25391      *            date1          date2
25392      *
25393      *         2450123.7           0.0       (JD method)
25394      *         2451545.0       -1421.3       (J2000 method)
25395      *         2400000.5       50123.2       (MJD method)
25396      *         2450123.5           0.2       (date &amp; time method)
25397      *     </pre>
25398      *     <p>The JD method is the most natural and convenient to use in cases
25399      *     where the loss of several decimal digits of resolution is
25400      *     acceptable.  The J2000 method is best matched to the way the
25401      *     argument is handled internally and will deliver the optimum
25402      *     resolution.  The MJD method and the date &amp; time methods are both
25403      *     good compromises between resolution and convenience.  For most
25404      *     applications of this function the choice will not be at all
25405      *     critical.
25406      *
25407      *     <p>TT can be used instead of TDB without any significant impact on
25408      *     accuracy.
25409      *
25410      *  <li> The vectors eb, eh, and all the astrom vectors, are with respect
25411      *     to BCRS axes.
25412      *
25413      *  <li> The geographical coordinates are with respect to the WGS84
25414      *     reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN
25415      *     CONVENTION:  the longitude required by the present function is
25416      *     right-handed, i.e. east-positive, in accordance with geographical
25417      *     convention.
25418      *     
25419      *     The adjusted longitude stored in the astrom array takes into
25420      *     account the TIO locator and polar motion.
25421 
25422      *
25423      *  <li> xp and yp are the coordinates (in radians) of the Celestial
25424      *     Intermediate Pole with respect to the International Terrestrial
25425      *     Reference System (see IERS Conventions), measured along the
25426      *     meridians 0 and 90 deg west respectively.  sp is the TIO locator
25427      *     s', in radians, which positions the Terrestrial Intermediate
25428      *     Origin on the equator.  For many applications, xp, yp and
25429      *     (especially) sp can be set to zero.
25430      *
25431      *     <p>Internally, the polar motion is stored in a form rotated onto the
25432      *     local meridian.
25433      *
25434      *  <li> The refraction constants refa and refb are for use in a
25435      *     dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
25436      *     (i.e. refracted) zenith distance and dZ is the amount of
25437      *     refraction.
25438      *
25439      *  <li> It is advisable to take great care with units, as even unlikely
25440      *     values of the input parameters are accepted and processed in
25441      *     accordance with the models used.
25442      *
25443      *  <li> In cases where the caller does not wish to provide the Earth
25444      *     Ephemeris, the Earth rotation information and refraction
25445      *     constants, the function iauApco13 can be used instead of the
25446      *     present function.  This starts from UTC and weather readings etc.
25447      *     and computes suitable values using other SOFA functions.
25448      *
25449      *  <li> This is one of several functions that inserts into the astrom
25450      *     structure star-independent parameters needed for the chain of
25451      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25452      *
25453      *     <p>The various functions support different classes of observer and
25454      *     portions of the transformation chain:
25455      *     <pre>{@code
25456      *          functions         observer        transformation
25457      *
25458      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25459      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25460      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25461      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25462      *       iauAper iauAper13    terrestrial     update Earth rotation
25463      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25464      *     }</pre>
25465      *     <p>Those with names ending in "13" use contemporary SOFA models to
25466      *     compute the various ephemerides.  The others accept ephemerides
25467      *     supplied by the caller.
25468      *
25469      *     <p>The transformation from ICRS to GCRS covers space motion,
25470      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25471      *     comprises frame bias and precession-nutation.  From CIRS to
25472      *     observed takes account of Earth rotation, polar motion, diurnal
25473      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25474      *     transformation), and atmospheric refraction.
25475      *
25476      *  <li> The context structure astrom produced by this function is used by
25477      *     iauAtioq, iauAtoiq, iauAtciq* and iauAticq*.
25478      *
25479      * </ol>
25480      *  Called:
25481      * <ul>
25482      *     <li>{@link #jauAper} astrometry parameters: update ERA
25483      *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, given X,Y and s
25484      *     <li>{@link #jauPvtob} position/velocity of terrestrial station
25485      *     <li>{@link #jauTrxpv} product of transpose of r-matrix and pv-vector
25486      *     <li>{@link #jauApcs} astrometry parameters, ICRS-GCRS, space observer
25487      *     <li>{@link #jauCr} copy r-matrix
25488      *
25489      * </ul>
25490      *@version  2013 October 9
25491      *
25492      *@since JSOFA release 20131202
25493      *
25494      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25495      * @throws JSOFAInternalError an internal error has occured
25496      * @throws JSOFAIllegalParameter unacceptable date
25497      */
25498     public static void jauApco(double date1, double date2,
25499             double ebpv[][], double ehp[],
25500             double x, double y, double s, double theta,
25501             double elong, double phi, double hm,
25502             double xp, double yp, double sp,
25503             double refa, double refb,
25504             Astrom astrom) throws JSOFAIllegalParameter, JSOFAInternalError
25505     {
25506         double a, b, eral, c, r[][] = new double[3][3], pvc[][], pv[][];
25507 
25508 
25509         /* Form the rotation matrix, CIRS to apparent [HA,Dec]. */
25510         jauIr(r);
25511         jauRz(theta+sp, r);
25512         jauRy(-xp, r);
25513         jauRx(-yp, r);
25514         jauRz(elong, r);
25515 
25516         /* Solve for local Earth rotation angle. */
25517         a = r[0][0];
25518         b = r[0][1];
25519         eral = ( a != 0.0 || b != 0.0 ) ?  atan2(b, a) : 0.0;
25520         astrom.eral = eral;
25521 
25522         /* Solve for polar motion [X,Y] with respect to local meridian. */
25523         a = r[0][0];
25524         c = r[0][2];
25525         astrom.xpl = atan2(c, sqrt(a*a+b*b));
25526         a = r[1][2];
25527         b = r[2][2];
25528         astrom.ypl = ( a != 0.0 || b != 0.0 ) ? -atan2(a, b) : 0.0;
25529 
25530         /* Adjusted longitude. */
25531         astrom.along = jauAnpm(eral - theta);
25532 
25533         /* Functions of latitude. */
25534         astrom.sphi = sin(phi);
25535         astrom.cphi = cos(phi);
25536 
25537         /* Refraction constants. */
25538         astrom.refa = refa;
25539         astrom.refb = refb;
25540 
25541         /* Disable the (redundant) diurnal aberration step. */
25542         astrom.diurab = 0.0;
25543 
25544         /* CIO based BPN matrix. */
25545         r = jauC2ixys(x, y, s);
25546 
25547         /* Observer's geocentric position and velocity (m, m/s, CIRS). */
25548         pvc = jauPvtob(elong, phi, hm, xp, yp, sp, theta);
25549 
25550         /* Rotate into GCRS. */
25551         pv = jauTrxpv(r, pvc);
25552 
25553         /* ICRS <-> GCRS parameters. */
25554         jauApcs(date1, date2, pv, ebpv, ehp, astrom);
25555 
25556         /* Store the CIO based BPN matrix. */
25557         jauCr(r, astrom.bpn );
25558 
25559         /* Finished. */
25560 
25561 
25562     }
25563 
25564     /**
25565      *  For a terrestrial observer, prepare star-independent astrometry
25566      *  parameters for transformations between ICRS and observed
25567      *  coordinates.  The caller supplies UTC, site coordinates, ambient air
25568      *  conditions and observing wavelength, and SOFA models are used to
25569      *  obtain the Earth ephemeris, CIP/CIO and refraction constants.
25570      *
25571      *  The parameters produced by this function are required in the
25572      *  parallax, light deflection, aberration, and bias-precession-nutation
25573      *  parts of the ICRS/CIRS transformations.
25574      *
25575      *<p>This function is derived from the International Astronomical Union's
25576      *  SOFA (Standards of Fundamental Astronomy) software collection.
25577      *
25578      *<p>Status:  support function.
25579      *
25580      *<!-- Given: -->
25581      *     @param utc1    double      UTC as a 2-part...
25582      *     @param utc2    double      ...quasi Julian Date (Notes 1,2)
25583      *     @param dut1    double      UT1-UTC (seconds, Note 3)
25584      *     @param elong   double      longitude (radians, east +ve, Note 4)
25585      *     @param phi     double      latitude (geodetic, radians, Note 4)
25586      *     @param hm      double      height above ellipsoid (m, geodetic, Notes 4,6)
25587      *     @param xp double      polar motion coordinates (radians, Note 5)
25588      *     @param yp double      polar motion coordinates (radians, Note 5) 
25589      *     @param phpa    double      pressure at the observer (hPa = mB, Note 6)
25590      *     @param tc      double      ambient temperature at the observer (deg C)
25591      *     @param rh      double      relative humidity at the observer (range 0-1)
25592      *     @param wl      double      wavelength (micrometers, Note 7)
25593      *
25594      *<!-- Returned:-->
25595      *     @param astrom     <b>Returned</b> star-independent astrometry parameters:
25596      *         
25597      *     
25598      *     @return       double      <b>Returned</b> equation of the origins (ERA-GST)
25599      *
25600      *  @throws JSOFAInternalError an internal error has occured
25601      *  @throws JSOFAIllegalParameter int         status:   <b>Returned</b> +1 = dubious year (Note 2)
25602      *                                 0  =   <b>Returned</b> OK
25603      *                                -1  =   <b>Returned</b> unacceptable date
25604      *
25605      *<p>Notes:
25606      * <ol>
25607      *
25608      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
25609      *      convenient way between the two arguments, for example where utc1
25610      *      is the Julian Day Number and utc2 is the fraction of a day.
25611      *
25612      *      <p>However, JD cannot unambiguously represent UTC during a leap
25613      *      second unless special measures are taken.  The convention in the
25614      *      present function is that the JD day represents UTC days whether
25615      *      the length is 86399, 86400 or 86401 SI seconds.
25616      *
25617      *      <p>Applications should use the function iauDtf2d to convert from
25618      *      calendar date and time of day into 2-part quasi Julian Date, as
25619      *      it implements the leap-second-ambiguity convention just
25620      *      described.
25621      *
25622      *  <li> The warning status "dubious year" flags UTCs that predate the
25623      *      introduction of the time scale or that are too far in the
25624      *      future to be trusted.  See iauDat for further details.
25625      *
25626      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
25627      *      one second at the end of each positive UTC leap second,
25628      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
25629      *      practice is under review, and in the future UT1-UTC may grow
25630      *      essentially without limit.
25631      *
25632      *  <li> The geographical coordinates are with respect to the WGS84
25633      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
25634      *      longitude required by the present function is east-positive
25635      *      (i.e. right-handed), in accordance with geographical convention.
25636      *
25637      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
25638      *      values are the coordinates (in radians) of the Celestial
25639      *      Intermediate Pole with respect to the International Terrestrial
25640      *      Reference System (see IERS Conventions 2003), measured along the
25641      *      meridians 0 and 90 deg west respectively.  For many
25642      *      applications, xp and yp can be set to zero.
25643      *
25644      *      <p>Internally, the polar motion is stored in a form rotated onto
25645      *      the local meridian.
25646      *
25647      *  <li> If hm, the height above the ellipsoid of the observing station
25648      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
25649      *      available, an adequate estimate of hm can be obtained from the
25650      *      expression
25651      *
25652      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
25653      *
25654      *      <p>where tsl is the approximate sea-level air temperature in K
25655      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
25656      *      52).  Similarly, if the pressure phpa is not known, it can be
25657      *      estimated from the height of the observing station, hm, as
25658      *      follows:
25659      *
25660      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
25661      *
25662      *      <p>Note, however, that the refraction is nearly proportional to
25663      *      the pressure and that an accurate phpa value is important for
25664      *      precise work.
25665      *
25666      *  <li> The argument wl specifies the observing wavelength in
25667      *      micrometers.  The transition from optical to radio is assumed to
25668      *      occur at 100 micrometers (about 3000 GHz).
25669      *
25670      *  <li> It is advisable to take great care with units, as even unlikely
25671      *      values of the input parameters are accepted and processed in
25672      *      accordance with the models used.
25673      *
25674      *  <li> In cases where the caller wishes to supply his own Earth
25675      *      ephemeris, Earth rotation information and refraction constants,
25676      *      the function iauApco can be used instead of the present function.
25677      *
25678      *  <li> This is one of several functions that inserts into the astrom
25679      *      structure star-independent parameters needed for the chain of
25680      *      astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25681      *
25682      *      <p>The various functions support different classes of observer and
25683      *      portions of the transformation chain:
25684      *      <pre>{@code
25685      *          functions         observer        transformation
25686      *
25687      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25688      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25689      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25690      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25691      *       iauAper iauAper13    terrestrial     update Earth rotation
25692      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25693      *      }</pre>
25694      *      <p>Those with names ending in "13" use contemporary SOFA models to
25695      *      compute the various ephemerides.  The others accept ephemerides
25696      *      supplied by the caller.
25697      *
25698      *      <p>The transformation from ICRS to GCRS covers space motion,
25699      *      parallax, light deflection, and aberration.  From GCRS to CIRS
25700      *      comprises frame bias and precession-nutation.  From CIRS to
25701      *      observed takes account of Earth rotation, polar motion, diurnal
25702      *      aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25703      *      transformation), and atmospheric refraction.
25704      *
25705      *  <li> The context structure astrom produced by this function is used
25706      *      by iauAtioq, iauAtoiq, iauAtciq* and iauAticq*.
25707      *
25708      * </ol>
25709      *  Called:
25710      * <ul>
25711      *     <li>{@link #jauUtctai} UTC to TAI
25712      *     <li>{@link #jauTaitt} TAI to TT
25713      *     <li>{@link #jauUtcut1} UTC to UT1
25714      *     <li>{@link #jauEpv00} Earth position and velocity
25715      *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
25716      *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
25717      *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
25718      *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
25719      *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
25720      *     <li>{@link #jauRefco} refraction constants for given ambient conditions
25721      *     <li>{@link #jauApco} astrometry parameters, ICRS-observed
25722      *     <li>{@link #jauEors} equation of the origins, given NPB matrix and s
25723      *
25724      * </ul>
25725      *@version  2013 December 5
25726      *
25727      *@since JSOFA release 20131202
25728      *
25729      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25730      * @throws JSOFAInternalError an internal error has occured
25731      * @throws JSOFAIllegalParameter unacceptable date.
25732      */
25733     public static double jauApco13(double utc1, double utc2, double dut1,
25734             double elong, double phi, double hm, double xp, double yp,
25735             double phpa, double tc, double rh, double wl,
25736             Astrom astrom ) throws JSOFAIllegalParameter, JSOFAInternalError
25737     {
25738         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3],
25739         r[][], s, theta, sp;
25740         double eo;
25741 
25742 
25743         /* UTC to other time scales. */
25744         JulianDate tai = jauUtctai(utc1, utc2);
25745         JulianDate tt = jauTaitt(tai.djm0, tai.djm1);
25746         JulianDate ut1 = jauUtcut1(utc1, utc2, dut1);
25747 
25748         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
25749         jauEpv00(tt.djm0, tt.djm1, ehpv, ebpv);
25750 
25751         /* Form the equinox based BPN matrix, IAU 2006/2000A. */
25752         r = jauPnm06a(tt.djm0, tt.djm1);
25753 
25754         /* Extract CIP X,Y. */
25755         CelestialIntermediatePole cip = jauBpn2xy(r);
25756 
25757         /* Obtain CIO locator s. */
25758         s = jauS06(tt.djm0, tt.djm1, cip.x, cip.y);
25759 
25760         /* Earth rotation angle. */
25761         theta = jauEra00(ut1.djm0, ut1.djm1);
25762 
25763         /* TIO locator s'. */
25764         sp = jauSp00(tt.djm0, tt.djm1);
25765 
25766         /* Refraction constants A and B. */
25767         RefCos ref = jauRefco(phpa, tc, rh, wl);
25768 
25769         /* Compute the star-independent astrometry parameters. */
25770         jauApco(tt.djm0, tt.djm1, ebpv, ehpv[0], cip.x, cip.y, s, theta,
25771                 elong, phi, hm, xp, yp, sp, ref.a, ref.b, astrom);
25772 
25773         /* Equation of the origins. */
25774         eo = jauEors(r, s);
25775 
25776         return eo;
25777 
25778         /* Finished. */
25779 
25780 
25781     }
25782 
25783     /**
25784      *  For an observer whose geocentric position and velocity are known,
25785      *  prepare star-independent astrometry parameters for transformations
25786      *  between ICRS and GCRS.  The Earth ephemeris is supplied by the
25787      *  caller.
25788      *
25789      *  The parameters produced by this function are required in the space
25790      *  motion, parallax, light deflection and aberration parts of the
25791      *  astrometric transformation chain.
25792      *
25793      *<p>This function is derived from the International Astronomical Union's
25794      *  SOFA (Standards of Fundamental Astronomy) software collection.
25795      *
25796      *<p>Status:  support function.
25797      *
25798      *<!-- Given: -->
25799      *     @param date1   double        TDB as a 2-part...
25800      *     @param date2   double        ...Julian Date (Note 1)
25801      *     @param pv      double[2][3]  observer's geocentric pos/vel (m, m/s)
25802      *     @param ebpv    double[2][3]  Earth barycentric PV (au, au/day)
25803      *     @param ehp     double[3]     Earth heliocentric P (au)
25804      *
25805      *<!-- Returned:-->
25806      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
25807 
25808      *<p>Notes:
25809      * <ol>
25810      *
25811      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25812      *     convenient way between the two arguments.  For example,
25813      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25814      *     others:
25815      *     <pre>
25816      *         date1          date2
25817      *
25818      *         2450123.7           0.0       (JD method)
25819      *         2451545.0       -1421.3       (J2000 method)
25820      *         2400000.5       50123.2       (MJD method)
25821      *         2450123.5           0.2       (date &amp; time method)
25822      *     </pre>
25823      *     <p>The JD method is the most natural and convenient to use in cases
25824      *     where the loss of several decimal digits of resolution is
25825      *     acceptable.  The J2000 method is best matched to the way the
25826      *     argument is handled internally and will deliver the optimum
25827      *     resolution.  The MJD method and the date &amp; time methods are both
25828      *     good compromises between resolution and convenience.  For most
25829      *     applications of this function the choice will not be at all
25830      *     critical.
25831      *
25832      *     <p>TT can be used instead of TDB without any significant impact on
25833      *     accuracy.
25834      *
25835      *  <li> All the vectors are with respect to BCRS axes.
25836      *
25837      *  <li> Providing separate arguments for (i) the observer's geocentric
25838      *     position and velocity and (ii) the Earth ephemeris is done for
25839      *     convenience in the geocentric, terrestrial and Earth orbit cases.
25840      *     For deep space applications it maybe more convenient to specify
25841      *     zero geocentric position and velocity and to supply the
25842      *     observer's position and velocity information directly instead of
25843      *     with respect to the Earth.  However, note the different units:
25844      *     m and m/s for the geocentric vectors, au and au/day for the
25845      *     heliocentric and barycentric vectors.
25846      *
25847      *  <li> In cases where the caller does not wish to provide the Earth
25848      *     ephemeris, the function iauApcs13 can be used instead of the
25849      *     present function.  This computes the Earth ephemeris using the
25850      *     SOFA function iauEpv00.
25851      *
25852      *  <li> This is one of several functions that inserts into the astrom
25853      *     structure star-independent parameters needed for the chain of
25854      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25855      *
25856      *     <p>The various functions support different classes of observer and
25857      *     portions of the transformation chain:
25858      *
25859      *     <pre>{@code
25860      *          functions         observer        transformation
25861      *
25862      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25863      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25864      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25865      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25866      *       iauAper iauAper13    terrestrial     update Earth rotation
25867      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25868      *     }</pre>
25869      *     <p>Those with names ending in "13" use contemporary SOFA models to
25870      *     compute the various ephemerides.  The others accept ephemerides
25871      *     supplied by the caller.
25872      *
25873      *     <p>The transformation from ICRS to GCRS covers space motion,
25874      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25875      *     comprises frame bias and precession-nutation.  From CIRS to
25876      *     observed takes account of Earth rotation, polar motion, diurnal
25877      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25878      *     transformation), and atmospheric refraction.
25879      *
25880      *  <li> The context structure astrom produced by this function is used by
25881      *     iauAtciq* and iauAticq*.
25882      *
25883      * </ol>
25884      *  Called:
25885      * <ul>
25886      *     <li>{@link #jauCp} copy p-vector
25887      *     <li>{@link #jauPm} modulus of p-vector
25888      *     <li>{@link #jauPn} decompose p-vector into modulus and direction
25889      *     <li>{@link #jauIr} initialize r-matrix to identity
25890      *
25891      * </ul>
25892      *@version  2013 October 9
25893      *
25894      *@since JSOFA release 20131202
25895      *
25896      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25897      */
25898     public static void jauApcs(double date1, double date2, double pv[][],
25899             double ebpv[][], double ehp[],
25900             Astrom astrom)
25901     {
25902         /* au/d to m/s */
25903         final double AUDMS = DAU/DAYSEC;
25904 
25905         /* Light time for 1 au (day) */
25906         final double CR = AULT/DAYSEC;
25907 
25908         int i;
25909         double dp, dv, pb[] = new double[3], vb[] = new double[3], ph[] = new double[3], v2, w;
25910 
25911 
25912         /* Time since reference epoch, years (for proper motion calculation). */
25913         astrom.pmt = ( (date1 - DJ00) + date2 ) / DJY;
25914 
25915         /* Adjust Earth ephemeris to observer. */
25916         for (i = 0; i < 3; i++) {
25917             dp = pv[0][i] / DAU;
25918             dv = pv[1][i] / AUDMS;
25919             pb[i] = ebpv[0][i] + dp;
25920             vb[i] = ebpv[1][i] + dv;
25921             ph[i] = ehp[i] + dp;
25922         }
25923 
25924         /* Barycentric position of observer (au). */
25925         jauCp(pb, astrom.eb);
25926 
25927         /* Heliocentric direction and distance (unit vector and au). */
25928         NormalizedVector nv = jauPn(ph);
25929         
25930         astrom.em = nv.r;
25931         astrom.eh = nv.u;
25932 
25933         /* Barycentric vel. in units of c, and reciprocal of Lorenz factor. */
25934         v2 = 0.0;
25935         for (i = 0; i < 3; i++) {
25936             w = vb[i] * CR;
25937             astrom.v[i] = w;
25938             v2 += w*w;
25939         }
25940         astrom.bm1 = sqrt(1.0 - v2);
25941 
25942         /* Reset the NPB matrix. */
25943         jauIr(astrom.bpn);
25944 
25945         /* Finished. */
25946 
25947 
25948     }
25949 
25950     /**
25951      *  For an observer whose geocentric position and velocity are known,
25952      *  prepare star-independent astrometry parameters for transformations
25953      *  between ICRS and GCRS.  The Earth ephemeris is from SOFA models.
25954      *
25955      *  The parameters produced by this function are required in the space
25956      *  motion, parallax, light deflection and aberration parts of the
25957      *  astrometric transformation chain.
25958      *
25959      *<p>This function is derived from the International Astronomical Union's
25960      *  SOFA (Standards of Fundamental Astronomy) software collection.
25961      *
25962      *<p>Status:  support function.
25963      *
25964      *<!-- Given: -->
25965      *     @param date1   double        TDB as a 2-part...
25966      *     @param date2   double        ...Julian Date (Note 1)
25967      *     @param pv      double[2][3]  observer's geocentric pos/vel (Note 3)
25968      *
25969      *<!-- Returned:-->
25970      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
25971      *
25972      *<p>Notes:
25973      * <ol>
25974      *
25975      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25976      *     convenient way between the two arguments.  For example,
25977      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25978      *     others:
25979      *     <pre>
25980      *           date1          date2
25981      *
25982      *         2450123.7           0.0       (JD method)
25983      *         2451545.0       -1421.3       (J2000 method)
25984      *         2400000.5       50123.2       (MJD method)
25985      *         2450123.5           0.2       (date &amp; time method)
25986      *     </pre>
25987      *     <p>The JD method is the most natural and convenient to use in cases
25988      *     where the loss of several decimal digits of resolution is
25989      *     acceptable.  The J2000 method is best matched to the way the
25990      *     argument is handled internally and will deliver the optimum
25991      *     resolution.  The MJD method and the date &amp; time methods are both
25992      *     good compromises between resolution and convenience.  For most
25993      *     applications of this function the choice will not be at all
25994      *     critical.
25995      *
25996      *     <p>TT can be used instead of TDB without any significant impact on
25997      *     accuracy.
25998      *
25999      *  <li> All the vectors are with respect to BCRS axes.
26000      *
26001      *  <li> The observer's position and velocity pv are geocentric but with
26002      *     respect to BCRS axes, and in units of m and m/s.  No assumptions
26003      *     are made about proximity to the Earth, and the function can be
26004      *     used for deep space applications as well as Earth orbit and
26005      *     terrestrial.
26006      *
26007      *  <li> In cases where the caller wishes to supply his own Earth
26008      *     ephemeris, the function iauApcs can be used instead of the present
26009      *     function.
26010      *
26011      *  <li> This is one of several functions that inserts into the astrom
26012      *     structure star-independent parameters needed for the chain of
26013      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26014      *
26015      *     <p>The various functions support different classes of observer and
26016      *     portions of the transformation chain:
26017      *     <pre>{@code
26018      *          functions         observer        transformation
26019      *
26020      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26021      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26022      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26023      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26024      *       iauAper iauAper13    terrestrial     update Earth rotation
26025      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26026      *     }</pre>
26027      *     <p>Those with names ending in "13" use contemporary SOFA models to
26028      *     compute the various ephemerides.  The others accept ephemerides
26029      *     supplied by the caller.
26030      *
26031      *     <p>The transformation from ICRS to GCRS covers space motion,
26032      *     parallax, light deflection, and aberration.  From GCRS to CIRS
26033      *     comprises frame bias and precession-nutation.  From CIRS to
26034      *     observed takes account of Earth rotation, polar motion, diurnal
26035      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26036      *     transformation), and atmospheric refraction.
26037      *
26038      *  <li> The context structure astrom produced by this function is used by
26039      *     iauAtciq* and iauAticq*.
26040      *
26041      * </ol>
26042      *  Called:
26043      * <ul>
26044      *     <li>{@link #jauEpv00} Earth position and velocity
26045      *     <li>{@link #jauApcs} astrometry parameters, ICRS-GCRS, space observer
26046      *
26047      * </ul>
26048      *@version  2013 October 9
26049      *
26050      *@since JSOFA release 20131202
26051      *
26052      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26053      */
26054     public static void jauApcs13(double date1, double date2, double pv[][],
26055             Astrom astrom)
26056     {
26057         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3];
26058 
26059 
26060         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
26061         jauEpv00(date1, date2, ehpv, ebpv);
26062 
26063         /* Compute the star-independent astrometry parameters. */
26064         jauApcs(date1, date2, pv, ebpv, ehpv[0], astrom);
26065 
26066         /* Finished. */
26067 
26068 
26069     }
26070 
26071     /**
26072      *  In the star-independent astrometry parameters, update only the
26073      *  Earth rotation angle, supplied by the caller explicitly.
26074      *
26075      *<p>This function is derived from the International Astronomical Union's
26076      *  SOFA (Standards of Fundamental Astronomy) software collection.
26077      *
26078      *<p>Status:  support function.
26079      *
26080      *<!-- Given: -->
26081      *     @param theta    double       Earth rotation angle (radians, Note 2)
26082      *     @param astrom  Astrom    star-independent astrometry parameters:{@code
26083      *          pmt     double        not used
26084      *          eb      double[3]     not used
26085      *          eh      double[3]     not used
26086      *          em      double        not used
26087      *          v       double[3]     not used
26088      *          bm1     double        not used
26089      *          bpn     double[3][3]  not used
26090      *          along   double        longitude + s' (radians)
26091      *          xpl     double        not used
26092      *          ypl     double        not used
26093      *          sphi    double        not used
26094      *          cphi    double        not used
26095      *          diurab  double        not used
26096      *          eral    double        not used
26097      *          refa    double        not used
26098      *          refb    double        not used}
26099      *
26100      *<!-- Returned:-->
26101      *     astrom       <b>Returned</b> star-independent astrometry parameters:
26102     *
26103      *<p>Notes:
26104      * <ol>
26105      *
26106      *  <li> This function exists to enable sidereal-tracking applications to
26107      *     avoid wasteful recomputation of the bulk of the astrometry
26108      *     parameters:  only the Earth rotation is updated.
26109      *
26110      *  <li> For targets expressed as equinox based positions, such as
26111      *     classical geocentric apparent (RA,Dec), the supplied theta can be
26112      *     Greenwich apparent sidereal time rather than Earth rotation
26113      *     angle.
26114      *
26115      *  <li> The function iauAper13 can be used instead of the present
26116      *     function, and starts from UT1 rather than ERA itself.
26117      *
26118      *  <li> This is one of several functions that inserts into the astrom
26119      *     structure star-independent parameters needed for the chain of
26120      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26121      *
26122      *     <p>The various functions support different classes of observer and
26123      *     portions of the transformation chain:
26124      *     <pre>{@code
26125      *          functions         observer        transformation
26126      *
26127      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26128      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26129      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26130      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26131      *       iauAper iauAper13    terrestrial     update Earth rotation
26132      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26133      *     }</pre>
26134      *     <p>Those with names ending in "13" use contemporary SOFA models to
26135      *     compute the various ephemerides.  The others accept ephemerides
26136      *     supplied by the caller.
26137      *
26138      *     <p>The transformation from ICRS to GCRS covers space motion,
26139      *     parallax, light deflection, and aberration.  From GCRS to CIRS
26140      *     comprises frame bias and precession-nutation.  From CIRS to
26141      *     observed takes account of Earth rotation, polar motion, diurnal
26142      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26143      *     transformation), and atmospheric refraction.
26144      *
26145      * </ol>
26146      *@version  2013 September 25
26147      *
26148      *@since JSOFA release 20131202
26149      *
26150      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26151      */
26152     public static void jauAper(double theta, Astrom astrom)
26153     {
26154         astrom.eral = theta + astrom.along;
26155 
26156         /* Finished. */
26157 
26158 
26159     }
26160 
26161     /**
26162      *  In the star-independent astrometry parameters, update only the
26163      *  Earth rotation angle.  The caller provides UT1, (n.b. not UTC).
26164      *
26165      *<p>This function is derived from the International Astronomical Union's
26166      *  SOFA (Standards of Fundamental Astronomy) software collection.
26167      *
26168      *<p>Status:  support function.
26169      *
26170      *<!-- Given: -->
26171      *     @param ut11     double       UT1 as a 2-part...
26172      *     @param ut12     double       ...Julian Date (Note 1)
26173      *     @param astrom      star-independent astrometry parameters:
26174      *                    pmt     double        not used
26175      *                    eb      double[3]     not used
26176      *                    eh      double[3]     not used
26177      *                    em      double        not used
26178      *                    v       double[3]     not used
26179      *                    bm1     double        not used
26180      *                    bpn     double[3][3]  not used
26181      *                    along   double        longitude + s' (radians)
26182      *                    xpl     double        not used
26183      *                    ypl     double        not used
26184      *                    sphi    double        not used
26185      *                    cphi    double        not used
26186      *                    diurab  double        not used
26187      *                    eral    double        not used
26188      *                    refa    double        not used
26189      *                    refb    double        not used
26190      *
26191      *<!-- Returned:-->
26192      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
26193      *
26194      *<p>Notes:
26195      * <ol>
26196      *
26197      *  <li> The UT1 date (n.b. not UTC) ut11+ut12 is a Julian Date,
26198      *     apportioned in any convenient way between the arguments ut11 and
26199      *     ut12.  For example, JD(UT1)=2450123.7 could be expressed in any
26200      *     of these ways, among others:
26201      *
26202      *            <p>ut11           ut12
26203      *
26204      *         2450123.7           0.0       (JD method)
26205      *         2451545.0       -1421.3       (J2000 method)
26206      *         2400000.5       50123.2       (MJD method)
26207      *         2450123.5           0.2       (date &amp; time method)
26208      *
26209      *     <p>The JD method is the most natural and convenient to use in cases
26210      *     where the loss of several decimal digits of resolution is
26211      *     acceptable.  The J2000 and MJD methods are good compromises
26212      *     between resolution and convenience.  The date &amp; time method is
26213      *     best matched to the algorithm used:  maximum precision is
26214      *     delivered when the ut11 argument is for 0hrs UT1 on the day in
26215      *     question and the ut12 argument lies in the range 0 to 1, or vice
26216      *     versa.
26217      *
26218      *  <li> If the caller wishes to provide the Earth rotation angle itself,
26219      *     the function iauAper can be used instead.  One use of this
26220      *     technique is to substitute Greenwich apparent sidereal time and
26221      *     thereby to support equinox based transformations directly.
26222      *
26223      *  <li> This is one of several functions that inserts into the astrom
26224      *     structure star-independent parameters needed for the chain of
26225      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26226      *
26227      *     <p>The various functions support different classes of observer and
26228      *     portions of the transformation chain:
26229      *     <pre>{@code
26230      *          functions         observer        transformation
26231      *
26232      *       <p>iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26233      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26234      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26235      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26236      *       iauAper iauAper13    terrestrial     update Earth rotation
26237      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26238      *     }</pre>
26239      *     <p>Those with names ending in "13" use contemporary SOFA models to
26240      *     compute the various ephemerides.  The others accept ephemerides
26241      *     supplied by the caller.
26242      *
26243      *     <p>The transformation from ICRS to GCRS covers space motion,
26244      *     parallax, light deflection, and aberration.  From GCRS to CIRS
26245      *     comprises frame bias and precession-nutation.  From CIRS to
26246      *     observed takes account of Earth rotation, polar motion, diurnal
26247      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26248      *     transformation), and atmospheric refraction.
26249      *
26250      * </ol>
26251      *  Called:
26252      * <ul>
26253      *     <li>{@link #jauAper} astrometry parameters: update ERA
26254      *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
26255      *
26256      * </ul>
26257      *@version  2013 September 25
26258      *
26259      *@since JSOFA release 20131202
26260      *
26261      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26262      */
26263     public static void jauAper13(double ut11, double ut12, Astrom astrom)
26264     {
26265         jauAper(jauEra00(ut11,ut12), astrom);
26266 
26267         /* Finished. */
26268 
26269 
26270     }
26271 
26272     /**
26273      *  For a terrestrial observer, prepare star-independent astrometry
26274      *  parameters for transformations between CIRS and observed
26275      *  coordinates.  The caller supplies the Earth orientation information
26276      *  and the refraction constants as well as the site coordinates.
26277      *
26278      *<p>This function is derived from the International Astronomical Union's
26279      *  SOFA (Standards of Fundamental Astronomy) software collection.
26280      *
26281      *<p>Status:  support function.
26282      *
26283      *<!-- Given: -->
26284      *     @param sp      double       the TIO locator s' (radians, Note 1)
26285      *     @param theta   double       Earth rotation angle (radians)
26286      *     @param elong   double       longitude (radians, east +ve, Note 2)
26287      *     @param phi     double       geodetic latitude (radians, Note 2)
26288      *     @param hm      double       height above ellipsoid (m, geodetic Note 2)
26289      *     @param xp double       polar motion coordinates (radians, Note 3)
26290      *     @param yp double       polar motion coordinates (radians, Note 3) 
26291      *     @param refa    double       refraction constant A (radians, Note 4)
26292      *     @param refb    double       refraction constant B (radians, Note 4)
26293      *
26294      *<!-- Returned:-->
26295      *     @param astrom  {@link Astrom}    <b>Returned</b> star-independent astrometry parameters:
26296      *     
26297      *<p>Notes:
26298      * <ol>
26299      *
26300      *  <li> sp, the TIO locator s', is a tiny quantity needed only by the
26301      *     most precise applications.  It can either be set to zero or
26302      *     predicted using the SOFA function iauSp00.
26303      *
26304      *  <li> The geographical coordinates are with respect to the WGS84
26305      *     reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
26306      *     longitude required by the present function is east-positive
26307      *     (i.e. right-handed), in accordance with geographical convention.
26308      *
26309      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
26310      *     values are the coordinates (in radians) of the Celestial
26311      *     Intermediate Pole with respect to the International Terrestrial
26312      *     Reference System (see IERS Conventions 2003), measured along the
26313      *     meridians 0 and 90 deg west respectively.  For many applications,
26314      *     xp and yp can be set to zero.
26315      *
26316      *     <p>Internally, the polar motion is stored in a form rotated onto the
26317      *     local meridian.
26318      *
26319      *  <li> The refraction constants refa and refb are for use in a
26320      *     dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
26321      *     (i.e. refracted) zenith distance and dZ is the amount of
26322      *     refraction.
26323      *
26324      *  <li> It is advisable to take great care with units, as even unlikely
26325      *     values of the input parameters are accepted and processed in
26326      *     accordance with the models used.
26327      *
26328      *  <li> In cases where the caller does not wish to provide the Earth
26329      *     rotation information and refraction constants, the function
26330      *     iauApio13 can be used instead of the present function.  This
26331      *     starts from UTC and weather readings etc. and computes suitable
26332      *     values using other SOFA functions.
26333      *
26334      *  <li> This is one of several functions that inserts into the astrom
26335      *     structure star-independent parameters needed for the chain of
26336      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26337      *
26338      *     <p>The various functions support different classes of observer and
26339      *     portions of the transformation chain:
26340      *<pre>{@code
26341      *          functions         observer        transformation
26342      *
26343      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26344      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26345      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26346      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26347      *       iauAper iauAper13    terrestrial     update Earth rotation
26348      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26349      *}</pre>
26350      *     <p>Those with names ending in "13" use contemporary SOFA models to
26351      *     compute the various ephemerides.  The others accept ephemerides
26352      *     supplied by the caller.
26353      *
26354      *     <p>The transformation from ICRS to GCRS covers space motion,
26355      *     parallax, light deflection, and aberration.  From GCRS to CIRS
26356      *     comprises frame bias and precession-nutation.  From CIRS to
26357      *     observed takes account of Earth rotation, polar motion, diurnal
26358      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26359      *     transformation), and atmospheric refraction.
26360      *
26361      *  <li> The context structure astrom produced by this function is used by
26362      *     iauAtioq and iauAtoiq.
26363      *
26364      * </ol>
26365      *  Called:
26366      * <ul>
26367      *     <li>{@link #jauPvtob} position/velocity of terrestrial station
26368      *     <li>{@link #jauAper} astrometry parameters: update ERA
26369      *
26370      * </ul>
26371      *@version  2013 October 9
26372      *
26373      *@since JSOFA release 20131202
26374      *
26375      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26376      * @throws JSOFAInternalError an internal error has occured
26377      * @throws JSOFAIllegalParameter unacceptable date.
26378      */
26379     public static void jauApio(double sp, double theta,
26380             double elong, double phi, double hm, double xp, double yp,
26381             double refa, double refb,
26382             Astrom astrom) throws JSOFAIllegalParameter, JSOFAInternalError
26383     {
26384         double r[][]=new double[3][3], a, b, eral, c, pv[][];
26385 
26386 
26387         /* Form the rotation matrix, CIRS to apparent [HA,Dec]. */
26388         jauIr(r);
26389         jauRz(theta+sp, r);
26390         jauRy(-xp, r);
26391         jauRx(-yp, r);
26392         jauRz(elong, r);
26393 
26394         /* Solve for local Earth rotation angle. */
26395         a = r[0][0];
26396         b = r[0][1];
26397         eral = ( a != 0.0 || b != 0.0 ) ?  atan2(b, a) : 0.0;
26398         astrom.eral = eral;
26399 
26400         /* Solve for polar motion [X,Y] with respect to local meridian. */
26401         a = r[0][0];
26402         c = r[0][2];
26403         astrom.xpl = atan2(c, sqrt(a*a+b*b));
26404         a = r[1][2];
26405         b = r[2][2];
26406         astrom.ypl = ( a != 0.0 || b != 0.0 ) ? -atan2(a, b) : 0.0;
26407 
26408         /* Adjusted longitude. */
26409         astrom.along = jauAnpm(eral - theta);
26410 
26411         /* Functions of latitude. */
26412         astrom.sphi = sin(phi);
26413         astrom.cphi = cos(phi);
26414 
26415         /* Observer's geocentric position and velocity (m, m/s, CIRS). */
26416         pv = jauPvtob(elong, phi, hm, xp, yp, sp, theta);
26417 
26418         /* Magnitude of diurnal aberration vector. */
26419         astrom.diurab = sqrt(pv[1][0]*pv[1][0]+pv[1][1]*pv[1][1]) / CMPS;
26420 
26421         /* Refraction constants. */
26422         astrom.refa = refa;
26423         astrom.refb = refb;
26424 
26425         /* Finished. */
26426 
26427 
26428     }
26429 
26430     /**
26431      *  For a terrestrial observer, prepare star-independent astrometry
26432      *  parameters for transformations between CIRS and observed
26433      *  coordinates.  The caller supplies UTC, site coordinates, ambient air
26434      *  conditions and observing wavelength.
26435      *
26436      *<p>This function is derived from the International Astronomical Union's
26437      *  SOFA (Standards of Fundamental Astronomy) software collection.
26438      *
26439      *<p>Status:  support function.
26440      *
26441      *<!-- Given: -->
26442      *     @param utc1    double       UTC as a 2-part...
26443      *     @param utc2    double       ...quasi Julian Date (Notes 1,2)
26444      *     @param dut1    double       UT1-UTC (seconds)
26445      *     @param elong   double       longitude (radians, east +ve, Note 3)
26446      *     @param phi     double       geodetic latitude (radians, Note 3)
26447      *     @param hm      double       height above ellipsoid (m, geodetic Notes 4,6)
26448      *     @param xp double       polar motion coordinates (radians, Note 5)
26449      *     @param yp double       polar motion coordinates (radians, Note 5) 
26450      *     @param phpa    double       pressure at the observer (hPa = mB, Note 6)
26451      *     @param tc      double       ambient temperature at the observer (deg C)
26452      *     @param rh      double       relative humidity at the observer (range 0-1)
26453      *     @param wl      double       wavelength (micrometers, Note 7)
26454      *
26455      *<!-- Returned:-->
26456      *     @param astrom      <b>Returned</b> star-independent astrometry parameters:
26457      *     @throws JSOFAInternalError an internal error has occured
26458      *     @throws JSOFAIllegalParameter int          status:   <b>Returned</b> +1 = dubious year (Note 2)
26459      *                                  0  =   <b>Returned</b> OK
26460      *                                 -1  =   <b>Returned</b> unacceptable date
26461      *
26462      *<p>Notes:
26463      * <ol>
26464      *
26465      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
26466      *      convenient way between the two arguments, for example where utc1
26467      *      is the Julian Day Number and utc2 is the fraction of a day.
26468      *
26469      *      <p>However, JD cannot unambiguously represent UTC during a leap
26470      *      second unless special measures are taken.  The convention in the
26471      *      present function is that the JD day represents UTC days whether
26472      *      the length is 86399, 86400 or 86401 SI seconds.
26473      *
26474      *      <p>Applications should use the function iauDtf2d to convert from
26475      *      calendar date and time of day into 2-part quasi Julian Date, as
26476      *      it implements the leap-second-ambiguity convention just
26477      *      described.
26478      *
26479      *  <li> The warning status "dubious year" flags UTCs that predate the
26480      *      introduction of the time scale or that are too far in the future
26481      *      to be trusted.  See iauDat for further details.
26482      *
26483      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
26484      *      one second at the end of each positive UTC leap second,
26485      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
26486      *      practice is under review, and in the future UT1-UTC may grow
26487      *      essentially without limit.
26488      *
26489      *  <li> The geographical coordinates are with respect to the WGS84
26490      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
26491      *      longitude required by the present function is east-positive
26492      *      (i.e. right-handed), in accordance with geographical convention.
26493      *
26494      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
26495      *      values are the coordinates (in radians) of the Celestial
26496      *      Intermediate Pole with respect to the International Terrestrial
26497      *      Reference System (see IERS Conventions 2003), measured along the
26498      *      meridians 0 and 90 deg west respectively.  For many applications,
26499      *      xp and yp can be set to zero.
26500      *
26501      *      <p>Internally, the polar motion is stored in a form rotated onto
26502      *      the local meridian.
26503      *
26504      *  <li> If hm, the height above the ellipsoid of the observing station
26505      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
26506      *      available, an adequate estimate of hm can be obtained from the
26507      *      expression
26508      *
26509      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
26510      *
26511      *      <p>where tsl is the approximate sea-level air temperature in K
26512      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
26513      *      52).  Similarly, if the pressure phpa is not known, it can be
26514      *      estimated from the height of the observing station, hm, as
26515      *      follows:
26516      *
26517      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
26518      *
26519      *      <p>Note, however, that the refraction is nearly proportional to the
26520      *      pressure and that an accurate phpa value is important for
26521      *      precise work.
26522      *
26523      *  <li> The argument wl specifies the observing wavelength in
26524      *      micrometers.  The transition from optical to radio is assumed to
26525      *      occur at 100 micrometers (about 3000 GHz).
26526      *
26527      *  <li> It is advisable to take great care with units, as even unlikely
26528      *      values of the input parameters are accepted and processed in
26529      *      accordance with the models used.
26530      *
26531      *  <li> In cases where the caller wishes to supply his own Earth
26532      *      rotation information and refraction constants, the function
26533      *      iauApc can be used instead of the present function.
26534      *
26535      *  <li> This is one of several functions that inserts into the astrom
26536      *      structure star-independent parameters needed for the chain of
26537      *      astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26538      *
26539      *      <p>The various functions support different classes of observer and
26540      *      portions of the transformation chain:
26541      *      <pre>{@code
26542      *          functions         observer        transformation
26543      *
26544      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26545      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26546      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26547      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26548      *       iauAper iauAper13    terrestrial     update Earth rotation
26549      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26550      *      }</pre>
26551      *      <p>Those with names ending in "13" use contemporary SOFA models to
26552      *      compute the various ephemerides.  The others accept ephemerides
26553      *      supplied by the caller.
26554      *
26555      *      <p>The transformation from ICRS to GCRS covers space motion,
26556      *      parallax, light deflection, and aberration.  From GCRS to CIRS
26557      *      comprises frame bias and precession-nutation.  From CIRS to
26558      *      observed takes account of Earth rotation, polar motion, diurnal
26559      *      aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26560      *      transformation), and atmospheric refraction.
26561      *
26562      *  <li> The context structure astrom produced by this function is used
26563      *      by iauAtioq and iauAtoiq.
26564      *
26565      * </ol>
26566      *  Called:
26567      * <ul>
26568      *     <li>{@link #jauUtctai} UTC to TAI
26569      *     <li>{@link #jauTaitt} TAI to TT
26570      *     <li>{@link #jauUtcut1} UTC to UT1
26571      *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
26572      *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
26573      *     <li>{@link #jauRefco} refraction constants for given ambient conditions
26574      *     <li>{@link #jauApio} astrometry parameters, CIRS-observed
26575      *
26576      * </ul>
26577      *@version  2013 October 9
26578      *
26579      *@since JSOFA release 20131202
26580      *
26581      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26582      * @throws JSOFAInternalError an internal error has occured
26583      * @throws JSOFAIllegalParameter unacceptable date.
26584      */
26585     public static void jauApio13(double utc1, double utc2, double dut1,
26586             double elong, double phi, double hm, double xp, double yp,
26587             double phpa, double tc, double rh, double wl,
26588             Astrom astrom) throws JSOFAIllegalParameter, JSOFAInternalError
26589     {
26590         double sp, theta;
26591 
26592 
26593         /* UTC to other time scales. */
26594         JulianDate tai = jauUtctai(utc1, utc2);
26595         JulianDate tt = jauTaitt(tai.djm0, tai.djm1);
26596         JulianDate ut1 = jauUtcut1(utc1, utc2, dut1);
26597 
26598         /* TIO locator s'. */
26599         sp = jauSp00(tt.djm0, tt.djm1);
26600 
26601         /* Earth rotation angle. */
26602         theta = jauEra00(ut1.djm0, ut1.djm1);
26603 
26604         /* Refraction constants A and B. */
26605         RefCos refco = jauRefco(phpa, tc, rh, wl);
26606 
26607         /* CIRS <-> observed astrometry parameters. */
26608         jauApio(sp, theta, elong, phi, hm, xp, yp, refco.a, refco.b, astrom);
26609 
26610        
26611         /* Finished. */
26612 
26613 
26614     }
26615 
26616     /**
26617      *  Transform ICRS star data, epoch J2000.0, to CIRS.
26618      *
26619      *<p>This function is derived from the International Astronomical Union's
26620      *  SOFA (Standards of Fundamental Astronomy) software collection.
26621      *
26622      *<p>Status:  support function.
26623      *
26624      *<!-- Given: -->
26625      *     @param rc      double    ICRS right ascension at J2000.0 (radians, Note 1)
26626      *     @param dc      double    ICRS declination at J2000.0 (radians, Note 1)
26627      *     @param pr      double    RA proper motion (radians/year; Note 2)
26628      *     @param pd      double    Dec proper motion (radians/year)
26629      *     @param px      double    parallax (arcsec)
26630      *     @param rv      double    radial velocity (km/s, +ve if receding)
26631      *     @param date1   double    TDB as a 2-part...
26632      *     @param date2   double    ...Julian Date (Note 3)
26633      *
26634      *<!-- Returned:-->
26635      *     @return    double*    <b>Returned</b> CIRS geocentric RA,Dec (radians)
26636      *        eo      double*    <b>Returned</b> equation of the origins (ERA-GST, Note 5)
26637      *
26638      *<p>Notes:
26639      * <ol>
26640      *
26641      *  <li> Star data for an epoch other than J2000.0 (for example from the
26642      *     Hipparcos catalog, which has an epoch of J1991.25) will require a
26643      *     preliminary call to iauPmsafe before use.
26644      *
26645      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
26646      *
26647      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
26648      *     convenient way between the two arguments.  For example,
26649      *     JD(TDB)=2450123.8g could be expressed in any of these ways, among
26650      *     others:
26651      *
26652      *            date1          date2
26653      *
26654      *         2450123.8g           0.0       (JD method)
26655      *         2451545.0       -1421.3       (J2000 method)
26656      *         2400000.5       50123.2       (MJD method)
26657      *         2450123.5           0.2       (date &amp; time method)
26658      *
26659      *     <p>The JD method is the most natural and convenient to use in cases
26660      *     where the loss of several decimal digits of resolution is
26661      *     acceptable.  The J2000 method is best matched to the way the
26662      *     argument is handled internally and will deliver the optimum
26663      *     resolution.  The MJD method and the date &amp; time methods are both
26664      *     good compromises between resolution and convenience.  For most
26665      *     applications of this function the choice will not be at all
26666      *     critical.
26667      *
26668      *     <p>TT can be used instead of TDB without any significant impact on
26669      *     accuracy.
26670      *
26671      *  <li> The available accuracy is better than 1 milliarcsecond, limited
26672      *     mainly by the precession-nutation model that is used, namely
26673      *     IAU 2000A/2006.  Very close to solar system bodies, additional
26674      *     errors of up to several milliarcseconds can occur because of
26675      *     unmodeled light deflection;  however, the Sun's contribution is
26676      *     taken into account, to first order.  The accuracy limitations of
26677      *     the SOFA function iauEpv00 (used to compute Earth position and
26678      *     velocity) can contribute aberration errors of up to
26679      *     5 microarcseconds.  Light deflection at the Sun's limb is
26680      *     uncertain at the 0.4 mas level.
26681      *
26682      *  <li> Should the transformation to (equinox based) apparent place be
26683      *     required rather than (CIO based) intermediate place, subtract the
26684      *     equation of the origins from the returned right ascension:
26685      *     RA = RI - EO. (The iauAnp function can then be applied, as
26686      *     required, to keep the result in the conventional 0-2pi range.)
26687      *
26688      * </ol>
26689      *  Called:
26690      * <ul>
26691      *     <li>{@link #jauApci13} astrometry parameters, ICRS-CIRS, 2013
26692      *     <li>{@link #jauAtciq} quick ICRS to CIRS
26693      *
26694      * </ul>
26695      *@version  2013 October 9
26696      *
26697      *@since JSOFA release 20131202
26698      *
26699      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26700      */
26701     public static SphericalCoordinateEO jauAtci13(double rc, double dc,
26702             double pr, double pd, double px, double rv,
26703             double date1, double date2)
26704     {
26705         /* Star-independent astrometry parameters */
26706         Astrom astrom = new Astrom();
26707 
26708 
26709         /* The transformation parameters. */
26710         double eo = jauApci13(date1, date2, astrom);
26711 
26712         /* ICRS (epoch J2000.0) to CIRS. */
26713         SphericalCoordinate co = jauAtciq(rc, dc, pr, pd, px, rv, astrom);
26714         
26715         return new SphericalCoordinateEO(co, eo);
26716         /* Finished. */
26717 
26718 
26719     }
26720 
26721     /**
26722      *  Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
26723      *  star-independent astrometry parameters.
26724      *
26725      *  Use of this function is appropriate when efficiency is important and
26726      *  where many star positions are to be transformed for one date.  The
26727      *  star-independent parameters can be obtained by calling one of the
26728      *  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
26729      *
26730      *  If the parallax and proper motions are zero the iauAtciqz function
26731      *  can be used instead.
26732      *
26733      *<p>This function is derived from the International Astronomical Union's
26734      *  SOFA (Standards of Fundamental Astronomy) software collection.
26735      *
26736      *<p>Status:  support function.
26737      *
26738      *<!-- Given: -->
26739      *     @param rc double      ICRS RA,Dec at J2000.0 (radians)
26740      *     @param dc double      ICRS RA,Dec at J2000.0 (radians) 
26741      *     @param pr      double      RA proper motion (radians/year; Note 3)
26742      *     @param pd      double      Dec proper motion (radians/year)
26743      *     @param px      double      parallax (arcsec)
26744      *     @param rv      double      radial velocity (km/s, +ve if receding)
26745      *     @param astrom    star-independent astrometry parameters:
26746      *
26747      *<!-- Returned:-->
26748      *     @return     double      <b>Returned</b> CIRS RA,Dec (radians)
26749      *
26750      *<p>Notes:
26751      * <ol>
26752      *
26753      *  <li> All the vectors are with respect to BCRS axes.
26754      *
26755      *  <li> Star data for an epoch other than J2000.0 (for example from the
26756      *     Hipparcos catalog, which has an epoch of J1991.25) will require a
26757      *     preliminary call to iauPmsafe before use.
26758      *
26759      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
26760      *
26761      * </ol>
26762      *  Called:
26763      * <ul>
26764      *     <li>{@link #jauPmpx} proper motion and parallax
26765      *     <li>{@link #jauLdsun} light deflection by the Sun
26766      *     <li>{@link #jauAb} stellar aberration
26767      *     <li>{@link #jauRxp} product of r-matrix and pv-vector
26768      *     <li>{@link #jauC2s} p-vector to spherical
26769      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
26770      *
26771      * </ul>
26772      *@version  2013 October 9
26773      *
26774      *@since JSOFA release 20131202
26775      *
26776      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26777      */
26778     public static SphericalCoordinate jauAtciq(double rc, double dc,
26779             double pr, double pd, double px, double rv,
26780             Astrom astrom)
26781     {
26782         double pco[], pnat[], ppr[], pi[];
26783 
26784 
26785         /* Proper motion and parallax, giving BCRS coordinate direction. */
26786         pco = jauPmpx(rc, dc, pr, pd, px, rv, astrom.pmt, astrom.eb);
26787 
26788         /* Light deflection by the Sun, giving BCRS natural direction. */
26789         pnat = jauLdsun(pco, astrom.eh, astrom.em);
26790 
26791         /* Aberration, giving GCRS proper direction. */
26792         ppr = jauAb(pnat, astrom.v, astrom.em, astrom.bm1);
26793 
26794         /* Bias-precession-nutation, giving CIRS proper direction. */
26795         pi = jauRxp(astrom.bpn, ppr);
26796 
26797         /* CIRS RA,Dec. */
26798         SphericalCoordinate co = jauC2s(pi);
26799         co.alpha = jauAnp(co.alpha);
26800 
26801         return co;
26802         /* Finished. */
26803 
26804 
26805     }
26806 
26807     /**
26808      *  Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
26809      *  star-independent astrometry parameters plus a list of light-
26810      *  deflecting bodies.
26811      *
26812      *  Use of this function is appropriate when efficiency is important and
26813      *  where many star positions are to be transformed for one date.  The
26814      *  star-independent parameters can be obtained by calling one of the
26815      *  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
26816      *
26817      *
26818      *  If the only light-deflecting body to be taken into account is the
26819      *  Sun, the iauAtciq function can be used instead.  If in addition the
26820      *  parallax and proper motions are zero, the iauAtciqz function can be
26821      *  used.
26822      *
26823      *<p>This function is derived from the International Astronomical Union's
26824      *  SOFA (Standards of Fundamental Astronomy) software collection.
26825      *
26826      *<p>Status:  support function.
26827      *
26828      *<!-- Given: -->
26829      *     @param rc double        ICRS RA,Dec at J2000.0 (radians)
26830      *     @param dc double        ICRS RA,Dec at J2000.0 (radians) 
26831      *     @param pr      double        RA proper motion (radians/year; Note 3)
26832      *     @param pd      double        Dec proper motion (radians/year)
26833      *     @param px      double        parallax (arcsec)
26834      *     @param rv      double        radial velocity (km/s, +ve if receding)
26835      *     @param astrom      star-independent astrometry parameters:
26836      *      @param n      int            number of bodies (Note 3)
26837      *      @param b      jauLDBODY[n]  data for each of the n bodies (Notes 3,4):
26838      *
26839      *<!-- Returned:-->
26840      *     @return ri,di    double      <b>Returned</b> CIRS RA,Dec (radians)
26841      *
26842      *<p>Notes:
26843      * <ol>
26844      *
26845      *  <li> Star data for an epoch other than J2000.0 (for example from the
26846      *     Hipparcos catalog, which has an epoch of J1991.25) will require a
26847      *     preliminary call to iauPmsafe before use.
26848      *
26849      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
26850      *
26851      *  <li> The struct b contains n entries, one for each body to be
26852      *     considered.  If n = 0, no gravitational light deflection will be
26853      *     applied, not even for the Sun.
26854      *
26855      *  <li> The struct b should include an entry for the Sun as well as for
26856      *     any planet or other body to be taken into account.  The entries
26857      *     should be in the order in which the light passes the body.
26858      *
26859      *  <li> In the entry in the b struct for body i, the mass parameter
26860      *     b[i].bm can, as required, be adjusted in order to allow for such
26861      *     effects as quadrupole field.
26862      *
26863      *  <li> The deflection limiter parameter b[i].dl is phi^2/2, where phi is
26864      *     the angular separation (in radians) between star and body at
26865      *     which limiting is applied.  As phi shrinks below the chosen
26866      *     threshold, the deflection is artificially reduced, reaching zero
26867      *     for phi = 0.   Example values suitable for a terrestrial
26868      *     observer, together with masses, are as follows:
26869      *     <pre>
26870      *        body i     b[i].bm        b[i].dl
26871      *
26872      *        Sun        1.0            6e-6
26873      *        Jupiter    0.00095435     3e-9
26874      *        Saturn     0.00028574     3e-10
26875      *     </pre>
26876      *  <li> For efficiency, validation of the contents of the b array is
26877      *     omitted.  The supplied masses must be greater than zero, the
26878      *     position and velocity vectors must be right, and the deflection
26879      *     limiter greater than zero.
26880      *
26881      * </ol>
26882      *  Called:
26883      * <ul>
26884      *     <li>{@link #jauPmpx} proper motion and parallax
26885      *     <li>{@link #jauLdn} light deflection by n bodies
26886      *     <li>{@link #jauAb} stellar aberration
26887      *     <li>{@link #jauRxp} product of r-matrix and pv-vector
26888      *     <li>{@link #jauC2s} p-vector to spherical
26889      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
26890      *
26891      * </ul>
26892      *@version  2013 October 9
26893      *
26894      *@since JSOFA release 20131202
26895      *
26896      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26897      */
26898     public static SphericalCoordinate jauAtciqn(double rc, double dc, double pr, double pd,
26899             double px, double rv, Astrom astrom,
26900             int n, Ldbody b[])
26901     {
26902         double pco[], pnat[], ppr[] = new double[3], pi[] = new double[3];
26903 
26904 
26905         /* Proper motion and parallax, giving BCRS coordinate direction. */
26906         pco = jauPmpx(rc, dc, pr, pd, px, rv, astrom.pmt, astrom.eb);
26907 
26908         /* Light deflection, giving BCRS natural direction. */
26909         pnat = jauLdn(n, b, astrom.eb, pco);
26910 
26911         /* Aberration, giving GCRS proper direction. */
26912         ppr = jauAb(pnat, astrom.v, astrom.em, astrom.bm1);
26913 
26914         /* Bias-precession-nutation, giving CIRS proper direction. */
26915         pi = jauRxp(astrom.bpn, ppr);
26916 
26917         /* CIRS RA,Dec. */
26918         SphericalCoordinate co = jauC2s(pi);
26919         co.alpha = jauAnp(co.alpha);
26920 
26921         return co;
26922         /* Finished. */
26923 
26924 
26925     }
26926 
26927     /**
26928      *  Quick ICRS to CIRS transformation, given precomputed star-
26929      *  independent astrometry parameters, and assuming zero parallax and
26930      *  proper motion.
26931      *
26932      *  Use of this function is appropriate when efficiency is important and
26933      *  where many star positions are to be transformed for one date.  The
26934      *  star-independent parameters can be obtained by calling one of the
26935      *  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
26936      *
26937      *  The corresponding function for the case of non-zero parallax and
26938      *  proper motion is iauAtciq.
26939      *
26940      *<p>This function is derived from the International Astronomical Union's
26941      *  SOFA (Standards of Fundamental Astronomy) software collection.
26942      *
26943      *<p>Status:  support function.
26944      *
26945      *<!-- Given: -->
26946      *     @param rc double      ICRS astrometric RA,Dec (radians)
26947      *     @param dc double      ICRS astrometric RA,Dec (radians) 
26948      *     @param astrom    star-independent astrometry parameters:
26949      *
26950      *<!-- Returned:-->
26951      *     @return ri,di   double       <b>Returned</b> CIRS RA,Dec (radians)
26952      *
26953      *  Note:
26954      *
26955      *     @return All  the   <b>Returned</b> vectors are with respect to BCRS axes.
26956      *
26957      *<p>References:
26958      * <ul>
26959      *
26960      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
26961      *     the Astronomical Almanac, 3rd ed., University Science Books
26962      *     (2013).
26963      *
26964      * <li> Klioner, Sergei A., "A practical relativistic model for micro-
26965      *     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
26966      *
26967      * </ul>
26968      *  Called:
26969      * <ul>
26970      *     <li>{@link #jauS2c} spherical coordinates to unit vector
26971      *     <li>{@link #jauLdsun} light deflection due to Sun
26972      *     <li>{@link #jauAb} stellar aberration
26973      *     <li>{@link #jauRxp} product of r-matrix and p-vector
26974      *     <li>{@link #jauC2s} p-vector to spherical
26975      *     <li>{@link #jauAnp} normalize angle into range +/- pi
26976      *
26977      * </ul>
26978      *@version  2013 October 9
26979      *
26980      *@since JSOFA release 20131202
26981      *
26982      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26983      */
26984     public static SphericalCoordinate jauAtciqz(double rc, double dc, Astrom astrom)
26985     {
26986         double pco[], pnat[], ppr[] = new double[3], pi[];
26987 
26988 
26989         /* BCRS coordinate direction (unit vector). */
26990         pco = jauS2c(rc, dc);
26991 
26992         /* Light deflection by the Sun, giving BCRS natural direction. */
26993         pnat = jauLdsun(pco, astrom.eh, astrom.em);
26994 
26995         /* Aberration, giving GCRS proper direction. */
26996         ppr = jauAb(pnat, astrom.v, astrom.em, astrom.bm1);
26997 
26998         /* Bias-precession-nutation, giving CIRS proper direction. */
26999         pi = jauRxp(astrom.bpn, ppr);
27000 
27001         /* CIRS RA,Dec. */
27002         SphericalCoordinate co = jauC2s(pi);
27003         co.alpha = jauAnp(co.alpha);
27004 
27005         return co;
27006         /* Finished. */
27007 
27008 
27009     }
27010 
27011     /**
27012      *  ICRS RA,Dec to observed place.  The caller supplies UTC, site
27013      *  coordinates, ambient air conditions and observing wavelength.
27014      *
27015      *  SOFA models are used for the Earth ephemeris, bias-precession-
27016      *  nutation, Earth orientation and refraction.
27017      *
27018      *<p>This function is derived from the International Astronomical Union's
27019      *  SOFA (Standards of Fundamental Astronomy) software collection.
27020      *
27021      *<p>Status:  support function.
27022      *
27023      *<!-- Given: -->
27024      *     @param rc double    ICRS right ascension at J2000.0 (radians, Note 1)
27025      *     @param dc double    ICRS right ascension at J2000.0 (radians, Note 1) 
27026      *     @param pr      double    RA proper motion (radians/year; Note 2)
27027      *     @param pd      double    Dec proper motion (radians/year)
27028      *     @param px      double    parallax (arcsec)
27029      *     @param rv      double    radial velocity (km/s, +ve if receding)
27030      *     @param utc1    double    UTC as a 2-part...
27031      *     @param utc2    double    ...quasi Julian Date (Notes 3-4)
27032      *     @param dut1    double    UT1-UTC (seconds, Note 5)
27033      *     @param elong   double    longitude (radians, east +ve, Note 6)
27034      *     @param phi     double    latitude (geodetic, radians, Note 6)
27035      *     @param hm      double    height above ellipsoid (m, geodetic, Notes 6,8)
27036      *     @param xp double    polar motion coordinates (radians, Note 7)
27037      *     @param yp double    polar motion coordinates (radians, Note 7) 
27038      *     @param phpa    double    pressure at the observer (hPa = mB, Note 8)
27039      *     @param tc      double    ambient temperature at the observer (deg C)
27040      *     @param rh      double    relative humidity at the observer (range 0-1)
27041      *     @param wl      double    wavelength (micrometers, Note 9)
27042      *
27043      *<!-- Returned:-->
27044      *     @return aob     double*    <b>Returned</b> observed azimuth (radians: N=0,E=90)
27045      *             zob     double*    <b>Returned</b> observed zenith distance (radians)
27046      *             hob     double*    <b>Returned</b> observed hour angle (radians)
27047      *             dob     double*    <b>Returned</b> observed declination (radians)
27048      *             rob     double*    <b>Returned</b> observed right ascension (CIO-based, radians)
27049      *             eo      double*    <b>Returned</b> equation of the origins (ERA-GST)
27050      *
27051      *  @throws JSOFAInternalError an internal error has occured
27052      *  @throws JSOFAIllegalParameter int       status:   <b>Returned</b> +1 = dubious year (Note 4)
27053      *                               0  =   <b>Returned</b> OK
27054      *                              -1  =   <b>Returned</b> unacceptable date
27055      *
27056      *<p>Notes:
27057      * <ol>
27058      *
27059      *  <li> Star data for an epoch other than J2000.0 (for example from the
27060      *      Hipparcos catalog, which has an epoch of J1991.25) will require
27061      *      a preliminary call to iauPmsafe before use.
27062      *
27063      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
27064      *
27065      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
27066      *      convenient way between the two arguments, for example where utc1
27067      *      is the Julian Day Number and utc2 is the fraction of a day.
27068      *
27069      *      <p>However, JD cannot unambiguously represent UTC during a leap
27070      *      second unless special measures are taken.  The convention in the
27071      *      present function is that the JD day represents UTC days whether
27072      *      the length is 86399, 86400 or 86401 SI seconds.
27073      *
27074      *      <p>Applications should use the function iauDtf2d to convert from
27075      *      calendar date and time of day into 2-part quasi Julian Date, as
27076      *      it implements the leap-second-ambiguity convention just
27077      *      described.
27078      *
27079      *  <li> The warning status "dubious year" flags UTCs that predate the
27080      *      introduction of the time scale or that are too far in the
27081      *      future to be trusted.  See iauDat for further details.
27082      *
27083      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
27084      *      one second at the end of each positive UTC leap second,
27085      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
27086      *      practice is under review, and in the future UT1-UTC may grow
27087      *      essentially without limit.
27088      *
27089      *  <li> The geographical coordinates are with respect to the WGS84
27090      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
27091      *      longitude required by the present function is east-positive
27092      *      (i.e. right-handed), in accordance with geographical convention.
27093      *
27094      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
27095      *      values are the coordinates (in radians) of the Celestial
27096      *      Intermediate Pole with respect to the International Terrestrial
27097      *      Reference System (see IERS Conventions 2003), measured along the
27098      *      meridians 0 and 90 deg west respectively.  For many
27099      *      applications, xp and yp can be set to zero.
27100      *
27101      *  <li> If hm, the height above the ellipsoid of the observing station
27102      *      in meters, is not known but phpa, the pressure in hPa (=mB),
27103      *      is available, an adequate estimate of hm can be obtained from
27104      *      the expression
27105      *
27106      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
27107      *
27108      *      <p>where tsl is the approximate sea-level air temperature in K
27109      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
27110      *      52).  Similarly, if the pressure phpa is not known, it can be
27111      *      estimated from the height of the observing station, hm, as
27112      *      follows:
27113      *
27114      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
27115      *
27116      *      <p>Note, however, that the refraction is nearly proportional to
27117      *      the pressure and that an accurate phpa value is important for
27118      *      precise work.
27119      *
27120      *  <li> The argument wl specifies the observing wavelength in
27121      *      micrometers.  The transition from optical to radio is assumed to
27122      *      occur at 100 micrometers (about 3000 GHz).
27123      *
27124      *  <li> The accuracy of the result is limited by the corrections for
27125      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
27126      *      Providing the meteorological parameters are known accurately and
27127      *      there are no gross local effects, the predicted observed
27128      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
27129      *      (radio) for a zenith distance of less than 70 degrees, better
27130      *      than 30 arcsec (optical or radio) at 85 degrees and better
27131      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
27132      *
27133      *      <p>Without refraction, the complementary functions iauAtco13 and
27134      *      iauAtoc13 are self-consistent to better than 1 microarcsecond
27135      *      all over the celestial sphere.  With refraction included,
27136      *      consistency falls off at high zenith distances, but is still
27137      *      better than 0.05 arcsec at 85 degrees.
27138      *
27139      *  <li> "Observed" Az,ZD means the position that would be seen by a
27140      *      perfect geodetically aligned theodolite.  (Zenith distance is
27141      *      used rather than altitude in order to reflect the fact that no
27142      *      allowance is made for depression of the horizon.)  This is
27143      *      related to the observed HA,Dec via the standard rotation, using
27144      *      the geodetic latitude (corrected for polar motion), while the
27145      *      observed HA and RA are related simply through the Earth rotation
27146      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
27147      *      means the position that would be seen by a perfect equatorial
27148      *      with its polar axis aligned to the Earth's axis of rotation.
27149      *
27150      *  <li> It is advisable to take great care with units, as even unlikely
27151      *      values of the input parameters are accepted and processed in
27152      *      accordance with the models used.
27153      *
27154      * </ol>
27155      *  Called:
27156      * <ul>
27157      *     <li>{@link #jauApco13} astrometry parameters, ICRS-observed, 2013
27158      *     <li>{@link #jauAtciq} quick ICRS to CIRS
27159      *     <li>{@link #jauAtioq} quick ICRS to observed
27160      *
27161      * </ul>
27162      *@version  2013 October 9
27163      *
27164      *@since JSOFA release 20131202
27165      *
27166      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27167      * @throws JSOFAInternalError an internal error has occured
27168      * @throws JSOFAIllegalParameter unacceptable date.
27169      */
27170     public static ObservedPositionEO jauAtco13(double rc, double dc,
27171             double pr, double pd, double px, double rv,
27172             double utc1, double utc2, double dut1,
27173             double elong, double phi, double hm, double xp, double yp,
27174             double phpa, double tc, double rh, double wl) throws JSOFAIllegalParameter, JSOFAInternalError
27175     {
27176         Astrom astrom = new Astrom();
27177 
27178 
27179         /* Star-independent astrometry parameters. */
27180         double eo = jauApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
27181                 phpa, tc, rh, wl, astrom);
27182 
27183         /* Transform ICRS to CIRS. */
27184         SphericalCoordinate co = jauAtciq(rc, dc, pr, pd, px, rv, astrom);
27185 
27186         /* Transform CIRS to observed. */
27187         ObservedPosition obs = jauAtioq(co.alpha, co.delta, astrom);
27188 
27189       
27190         return new ObservedPositionEO(obs, eo);
27191         
27192         /* Finished. */
27193 
27194 
27195     }
27196 
27197     /**
27198      *  Transform star RA,Dec from geocentric CIRS to ICRS astrometric.
27199      *
27200      *<p>This function is derived from the International Astronomical Union's
27201      *  SOFA (Standards of Fundamental Astronomy) software collection.
27202      *
27203      *<p>Status:  support function.
27204      *
27205      *<!-- Given: -->
27206      *     @param ri double   CIRS geocentric RA,Dec (radians)
27207      *     @param di double   CIRS geocentric RA,Dec (radians) 
27208      *     @param date1   double   TDB as a 2-part...
27209      *     @param date2   double   ...Julian Date (Note 1)
27210      *
27211      *<!-- Returned:-->
27212      *     @return rc,dc   double    <b>Returned</b> ICRS astrometric RA,Dec (radians)
27213      *      eo      double    <b>Returned</b> equation of the origins (ERA-GST, Note 4)
27214      *
27215      *<p>Notes:
27216      * <ol>
27217      *
27218      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
27219      *     convenient way between the two arguments.  For example,
27220      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
27221      *     others:
27222      *
27223      *            date1          date2
27224      *
27225      *         2450123.7           0.0       (JD method)
27226      *         2451545.0       -1421.3       (J2000 method)
27227      *         2400000.5       50123.2       (MJD method)
27228      *         2450123.5           0.2       (date &amp; time method)
27229      *
27230      *     <p>The JD method is the most natural and convenient to use in cases
27231      *     where the loss of several decimal digits of resolution is
27232      *     acceptable.  The J2000 method is best matched to the way the
27233      *     argument is handled internally and will deliver the optimum
27234      *     resolution.  The MJD method and the date &amp; time methods are both
27235      *     good compromises between resolution and convenience.  For most
27236      *     applications of this function the choice will not be at all
27237      *     critical.
27238      *
27239      *     <p>TT can be used instead of TDB without any significant impact on
27240      *     accuracy.
27241      *
27242      *  <li> Iterative techniques are used for the aberration and light
27243      *     deflection corrections so that the functions iauAtic13 (or
27244      *     iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
27245      *     even at the edge of the Sun's disk the discrepancy is only about
27246      *     1 nanoarcsecond.
27247      *
27248      *  <li> The available accuracy is better than 1 milliarcsecond, limited
27249      *     mainly by the precession-nutation model that is used, namely
27250      *     IAU 2000A/2006.  Very close to solar system bodies, additional
27251      *     errors of up to several milliarcseconds can occur because of
27252      *     unmodeled light deflection;  however, the Sun's contribution is
27253      *     taken into account, to first order.  The accuracy limitations of
27254      *     the SOFA function iauEpv00 (used to compute Earth position and
27255      *     velocity) can contribute aberration errors of up to
27256      *     5 microarcseconds.  Light deflection at the Sun's limb is
27257      *     uncertain at the 0.4 mas level.
27258      *
27259      *  <li> Should the transformation to (equinox based) J2000.0 mean place
27260      *     be required rather than (CIO based) ICRS coordinates, subtract the
27261      *     equation of the origins from the returned right ascension:
27262      *     RA = RI - EO.  (The iauAnp function can then be applied, as
27263      *     required, to keep the result in the conventional 0-2pi range.)
27264      *
27265      * </ol>
27266      *  Called:
27267      * <ul>
27268      *     <li>{@link #jauApci13} astrometry parameters, ICRS-CIRS, 2013
27269      *     <li>{@link #jauAticq} quick CIRS to ICRS astrometric
27270      *
27271      * </ul>
27272      *@version  2013 October 9
27273      *
27274      *@since JSOFA release 20131202
27275      *
27276      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27277      */
27278     public static SphericalCoordinateEO jauAtic13(double ri, double di, double date1, double date2)
27279     {
27280         /* Star-independent astrometry parameters */
27281         Astrom astrom = new Astrom();
27282 
27283 
27284         /* Star-independent astrometry parameters. */
27285         double eo = jauApci13(date1, date2, astrom);
27286 
27287         /* CIRS to ICRS astrometric. */
27288         SphericalCoordinate co = jauAticq(ri, di, astrom);
27289 
27290         return new SphericalCoordinateEO(co,eo);
27291         /* Finished. */
27292 
27293 
27294     }
27295 
27296     /**
27297      *  Quick CIRS RA,Dec to ICRS astrometric place, given the star-
27298      *  independent astrometry parameters.
27299      *
27300      *  Use of this function is appropriate when efficiency is important and
27301      *  where many star positions are all to be transformed for one date.
27302      *  The star-independent astrometry parameters can be obtained by
27303      *  calling one of the functions iauApci[13], iauApcg[13], iauApco[13]
27304      *  or iauApcs[13].
27305      *
27306      *<p>This function is derived from the International Astronomical Union's
27307      *  SOFA (Standards of Fundamental Astronomy) software collection.
27308      *
27309      *<p>Status:  support function.
27310      *
27311      *<!-- Given: -->
27312      *     @param ri double      CIRS RA,Dec (radians)
27313      *     @param di double      CIRS RA,Dec (radians) 
27314      *     @param astrom    star-independent astrometry parameters:
27315      *
27316      *<!-- Returned:-->
27317      *     @return rc,dc   double       <b>Returned</b> ICRS astrometric RA,Dec (radians)
27318      *
27319      *<p>Notes:
27320      * <ol>
27321      *
27322      *  <li> Only the Sun is taken into account in the light deflection
27323      *     correction.
27324      *
27325      *  <li> Iterative techniques are used for the aberration and light
27326      *     deflection corrections so that the functions iauAtic13 (or
27327      *     iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
27328      *     even at the edge of the Sun's disk the discrepancy is only about
27329      *     1 nanoarcsecond.
27330      *
27331      * </ol>
27332      *  Called:
27333      * <ul>
27334      *     <li>{@link #jauS2c} spherical coordinates to unit vector
27335      *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
27336      *     <li>{@link #jauZp} zero p-vector
27337      *     <li>{@link #jauAb} stellar aberration
27338      *     <li>{@link #jauLdsun} light deflection by the Sun
27339      *     <li>{@link #jauC2s} p-vector to spherical
27340      *     <li>{@link #jauAnp} normalize angle into range +/- pi
27341      *
27342      * </ul>
27343      *@version  2013 October 9
27344      *
27345      *@since JSOFA release 20131202
27346      *
27347      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27348      */
27349     public static SphericalCoordinate  jauAticq(double ri, double di, Astrom astrom )
27350     {
27351         int j, i;
27352         double pi[] , ppr[], pnat[] = new double[3], pco[] = new double[3], w, d[] = new double[3], 
27353                 before[] = new double[3], r2, r,
27354                 after[];
27355 
27356 
27357         /* CIRS RA,Dec to Cartesian. */
27358         pi = jauS2c(ri, di);
27359 
27360         /* Bias-precession-nutation, giving GCRS proper direction. */
27361         ppr = jauTrxp(astrom.bpn, pi);
27362 
27363         /* Aberration, giving GCRS natural direction. */
27364         jauZp(d);
27365         for (j = 0; j < 2; j++) {
27366             r2 = 0.0;
27367             for (i = 0; i < 3; i++) {
27368                 w = ppr[i] - d[i];
27369                 before[i] = w;
27370                 r2 += w*w;
27371             }
27372             r = sqrt(r2);
27373             for (i = 0; i < 3; i++) {
27374                 before[i] /= r;
27375             }
27376             after = jauAb(before, astrom.v, astrom.em, astrom.bm1);
27377             r2 = 0.0;
27378             for (i = 0; i < 3; i++) {
27379                 d[i] = after[i] - before[i];
27380                 w = ppr[i] - d[i];
27381                 pnat[i] = w;
27382                 r2 += w*w;
27383             }
27384             r = sqrt(r2);
27385             for (i = 0; i < 3; i++) {
27386                 pnat[i] /= r;
27387             }
27388         }
27389 
27390         /* Light deflection by the Sun, giving BCRS coordinate direction. */
27391         jauZp(d);
27392         for (j = 0; j < 5; j++) {
27393             r2 = 0.0;
27394             for (i = 0; i < 3; i++) {
27395                 w = pnat[i] - d[i];
27396                 before[i] = w;
27397                 r2 += w*w;
27398             }
27399             r = sqrt(r2);
27400             for (i = 0; i < 3; i++) {
27401                 before[i] /= r;
27402             }
27403             after = jauLdsun(before, astrom.eh, astrom.em);
27404             r2 = 0.0;
27405             for (i = 0; i < 3; i++) {
27406                 d[i] = after[i] - before[i];
27407                 w = pnat[i] - d[i];
27408                 pco[i] = w;
27409                 r2 += w*w;
27410             }
27411             r = sqrt(r2);
27412             for (i = 0; i < 3; i++) {
27413                 pco[i] /= r;
27414             }
27415         }
27416 
27417         /* ICRS astrometric RA,Dec. */
27418         SphericalCoordinate co = jauC2s(pco);
27419         co.alpha = jauAnp(co.alpha);
27420 
27421         return co;
27422         /* Finished. */
27423 
27424 
27425     }
27426 
27427     /**
27428      *  Quick CIRS to ICRS astrometric place transformation, given the star-
27429      *  independent astrometry parameters plus a list of light-deflecting
27430      *  bodies.
27431      *
27432      *  Use of this function is appropriate when efficiency is important and
27433      *  where many star positions are all to be transformed for one date.
27434      *  The star-independent astrometry parameters can be obtained by
27435      *  calling one of the functions iauApci[13], iauApcg[13], iauApco[13]
27436      *  or iauApcs[13].
27437      *
27438      *  If the only light-deflecting body to be taken into account is the
27439      *  Sun, the iauAticq function can be used instead.
27440      *
27441      *<p>This function is derived from the International Astronomical Union's
27442      *  SOFA (Standards of Fundamental Astronomy) software collection.
27443      *
27444      *<p>Status:  support function.
27445      *
27446      *<!-- Given: -->
27447      *     @param ri double       CIRS RA,Dec (radians)
27448      *     @param di double       CIRS RA,Dec (radians) 
27449      *     @param astrom     star-independent astrometry parameters:
27450      *     @param n number of bodies.
27451      *     @param b[] data for each of the n bodies.
27452      *
27453      *<!-- Returned:-->
27454      *     @return        ICRS astrometric RA,Dec (radians)
27455      *
27456      *<p>Notes:
27457      * <ol>
27458      *
27459      *  <li> Iterative techniques are used for the aberration and light
27460      *     deflection corrections so that the functions iauAticqn and
27461      *     iauAtciqn are accurate inverses; even at the edge of the Sun's
27462      *     disk the discrepancy is only about 1 nanoarcsecond.
27463      *
27464      *  <li> If the only light-deflecting body to be taken into account is the
27465      *     Sun, the iauAticq function can be used instead.
27466      *
27467      *  <li> The struct b contains n entries, one for each body to be
27468      *     considered.  If n = 0, no gravitational light deflection will be
27469      *     applied, not even for the Sun.
27470      *
27471      *  <li> The struct b should include an entry for the Sun as well as for
27472      *     any planet or other body to be taken into account.  The entries
27473      *     should be in the order in which the light passes the body.
27474      *
27475      *  <li> In the entry in the b struct for body i, the mass parameter
27476      *     b[i].bm can, as required, be adjusted in order to allow for such
27477      *     effects as quadrupole field.
27478      *
27479      *  <li> The deflection limiter parameter b[i].dl is phi^2/2, where phi is
27480      *     the angular separation (in radians) between star and body at
27481      *     which limiting is applied.  As phi shrinks below the chosen
27482      *     threshold, the deflection is artificially reduced, reaching zero
27483      *     for phi = 0.   Example values suitable for a terrestrial
27484      *     observer, together with masses, are as follows:
27485      *
27486      *        <p>body i     b[i].bm        b[i].dl
27487      *
27488      *        <p>Sun        1.0            6e-6
27489      *        Jupiter    0.00095435     3e-9
27490      *        Saturn     0.00028574     3e-10
27491      *
27492      *  <li> For efficiency, validation of the contents of the b array is
27493      *     omitted.  The supplied masses must be greater than zero, the
27494      *     position and velocity vectors must be right, and the deflection
27495      *     limiter greater than zero.
27496      *
27497      * </ol>
27498      *  Called:
27499      * <ul>
27500      *     <li>{@link #jauS2c} spherical coordinates to unit vector
27501      *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
27502      *     <li>{@link #jauZp} zero p-vector
27503      *     <li>{@link #jauAb} stellar aberration
27504      *     <li>{@link #jauLdn} light deflection by n bodies
27505      *     <li>{@link #jauC2s} p-vector to spherical
27506      *     <li>{@link #jauAnp} normalize angle into range +/- pi
27507      *
27508      * </ul>
27509      *@version  2013 October 9
27510      *
27511      *@since JSOFA release 20131202
27512      *
27513      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27514      */
27515     public static SphericalCoordinate jauAticqn(double ri, double di, Astrom astrom,
27516             int n, Ldbody b[])
27517     {
27518         int j, i;
27519         double pi[], ppr[], pnat[] = new double[3], pco[] = new double[3], w, d[] = new double[3], before[] = new double[3], r2, r,
27520                 after[];
27521 
27522 
27523         /* CIRS RA,Dec to Cartesian. */
27524         pi = jauS2c(ri, di);
27525 
27526         /* Bias-precession-nutation, giving GCRS proper direction. */
27527         ppr = jauTrxp(astrom.bpn, pi);
27528 
27529         /* Aberration, giving GCRS natural direction. */
27530         jauZp(d);
27531         for (j = 0; j < 2; j++) {
27532             r2 = 0.0;
27533             for (i = 0; i < 3; i++) {
27534                 w = ppr[i] - d[i];
27535                 before[i] = w;
27536                 r2 += w*w;
27537             }
27538             r = sqrt(r2);
27539             for (i = 0; i < 3; i++) {
27540                 before[i] /= r;
27541             }
27542             after = jauAb(before, astrom.v, astrom.em, astrom.bm1);
27543             r2 = 0.0;
27544             for (i = 0; i < 3; i++) {
27545                 d[i] = after[i] - before[i];
27546                 w = ppr[i] - d[i];
27547                 pnat[i] = w;
27548                 r2 += w*w;
27549             }
27550             r = sqrt(r2);
27551             for (i = 0; i < 3; i++) {
27552                 pnat[i] /= r;
27553             }
27554         }
27555 
27556         /* Light deflection, giving BCRS coordinate direction. */
27557         jauZp(d);
27558         for (j = 0; j < 5; j++) {
27559             r2 = 0.0;
27560             for (i = 0; i < 3; i++) {
27561                 w = pnat[i] - d[i];
27562                 before[i] = w;
27563                 r2 += w*w;
27564             }
27565             r = sqrt(r2);
27566             for (i = 0; i < 3; i++) {
27567                 before[i] /= r;
27568             }
27569             after = jauLdn(n, b, astrom.eb, before);
27570             r2 = 0.0;
27571             for (i = 0; i < 3; i++) {
27572                 d[i] = after[i] - before[i];
27573                 w = pnat[i] - d[i];
27574                 pco[i] = w;
27575                 r2 += w*w;
27576             }
27577             r = sqrt(r2);
27578             for (i = 0; i < 3; i++) {
27579                 pco[i] /= r;
27580             }
27581         }
27582 
27583         /* ICRS astrometric RA,Dec. */
27584         SphericalCoordinate co = jauC2s(pco);
27585         co.alpha = jauAnp(co.alpha);
27586 
27587         return co;
27588         /* Finished. */
27589 
27590 
27591     }
27592     
27593     /**
27594      * Observed Position.
27595      *  "Observed" Az,ZD means the position that would be seen by a
27596      *      perfect geodetically aligned theodolite.  (Zenith distance is
27597      *      used rather than altitude in order to reflect the fact that no
27598      *      allowance is made for depression of the horizon.)  This is
27599      *      related to the observed HA,Dec via the standard rotation, using
27600      *      the geodetic latitude (corrected for polar motion), while the
27601      *      observed HA and RA are related simply through the Earth rotation
27602      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
27603      *      means the position that would be seen by a perfect equatorial
27604      *      with its polar axis aligned to the Earth's axis of rotation..
27605      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Mar 2014
27606      * @version $Revision$ $date$
27607      */
27608     public static class ObservedPosition{
27609         /**    observed azimuth (radians: N=0,E=90) */
27610         public double   aob;
27611 
27612         /**    observed zenith distance (radians)   */
27613         public double   zob;
27614 
27615         /**    observed Hour Angle (radians)        */
27616         public double   hob;
27617 
27618         /**    observed Declination (radians)       */
27619         public double   dob;
27620 
27621         /**    observed Right Ascension (radians)   */
27622         public double   rob;
27623         public ObservedPosition(double   aob,
27624                 double   zob,
27625                 double   hob,
27626                 double   dob,
27627                 double   rob
27628         ) {
27629             this.aob =  aob;
27630             this.zob =  zob;
27631             this.hob =  hob;
27632             this.dob =  dob;
27633             this.rob =  rob;  
27634         }
27635     }
27636     
27637     /**
27638      * Observed position with the equation of the origins.
27639      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 29 Mar 2014
27640      * @version $Revision$ $date$
27641      */
27642     public static class ObservedPositionEO {
27643        /**
27644         * observed position.
27645         */
27646         public ObservedPosition op;
27647         /**
27648          * The equation of the origins.    The equation of the origins is the distance between the true
27649          *  equinox and the celestial intermediate origin and, equivalently,
27650          *  the difference between Earth rotation angle and Greenwich
27651          *  apparent sidereal time (ERA-GST).  It comprises the precession
27652          *  (since J2000.0) in right ascension plus the equation of the
27653          *  equinoxes (including the small correction terms).   
27654          */
27655         public double eo;
27656         /**
27657          * @param op the observed position.
27658          * @param eo the equation of the origins.
27659          */
27660         public ObservedPositionEO(ObservedPosition op, double eo) {
27661             this.op = op;
27662             this.eo = eo;
27663         }
27664         
27665     }
27666 
27667     
27668     
27669     
27670     /**
27671      *  CIRS RA,Dec to observed place.  The caller supplies UTC, site
27672      *  coordinates, ambient air conditions and observing wavelength.
27673      *
27674      *<p>This function is derived from the International Astronomical Union's
27675      *  SOFA (Standards of Fundamental Astronomy) software collection.
27676      *
27677      *<p>Status:  support function.
27678      *
27679      *<!-- Given: -->
27680      *     @param ri      double    CIRS right ascension (CIO-based, radians)
27681      *     @param di      double    CIRS declination (radians)
27682      *     @param utc1    double    UTC as a 2-part...
27683      *     @param utc2    double    ...quasi Julian Date (Notes 1,2)
27684      *     @param dut1    double    UT1-UTC (seconds, Note 3)
27685      *     @param elong   double    longitude (radians, east +ve, Note 4)
27686      *     @param phi     double    geodetic latitude (radians, Note 4)
27687      *     @param hm      double    height above ellipsoid (m, geodetic Notes 4,6)
27688      *     @param xp double    polar motion coordinates (radians, Note 5)
27689      *     @param yp double    polar motion coordinates (radians, Note 5) 
27690      *     @param phpa    double    pressure at the observer (hPa = mB, Note 6)
27691      *     @param tc      double    ambient temperature at the observer (deg C)
27692      *     @param rh      double    relative humidity at the observer (range 0-1)
27693      *     @param wl      double    wavelength (micrometers, Note 7)
27694      *
27695      *<!-- Returned:-->
27696      *     @return aob     double*    <b>Returned</b> observed azimuth (radians: N=0,E=90)
27697      *             zob     double*    <b>Returned</b> observed zenith distance (radians)
27698      *             hob     double*    <b>Returned</b> observed hour angle (radians)
27699      *             dob     double*    <b>Returned</b> observed declination (radians)
27700      *             rob     double*    <b>Returned</b> observed right ascension (CIO-based, radians)
27701      *
27702      *  @throws JSOFAInternalError an internal error has occured
27703      *  @throws JSOFAIllegalParameter int       status:   <b>Returned</b> +1 = dubious year (Note 2)
27704      *                              0  =   <b>Returned</b> OK
27705      *                              -1  =   <b>Returned</b> unacceptable date
27706      *
27707      *<p>Notes:
27708      * <ol>
27709      *
27710      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
27711      *      convenient way between the two arguments, for example where utc1
27712      *      is the Julian Day Number and utc2 is the fraction of a day.
27713      *
27714      *      <p>However, JD cannot unambiguously represent UTC during a leap
27715      *      second unless special measures are taken.  The convention in the
27716      *      present function is that the JD day represents UTC days whether
27717      *      the length is 86399, 86400 or 86401 SI seconds.
27718      *
27719      *      <p>Applications should use the function iauDtf2d to convert from
27720      *      calendar date and time of day into 2-part quasi Julian Date, as
27721      *      it implements the leap-second-ambiguity convention just
27722      *      described.
27723      *
27724      *  <li> The warning status "dubious year" flags UTCs that predate the
27725      *      introduction of the time scale or that are too far in the
27726      *      future to be trusted.  See iauDat for further details.
27727      *
27728      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
27729      *      one second at the end of each positive UTC leap second,
27730      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
27731      *      practice is under review, and in the future UT1-UTC may grow
27732      *      essentially without limit.
27733      *
27734      *  <li> The geographical coordinates are with respect to the WGS84
27735      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
27736      *      longitude required by the present function is east-positive
27737      *      (i.e. right-handed), in accordance with geographical convention.
27738      *
27739      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
27740      *      values are the coordinates (in radians) of the Celestial
27741      *      Intermediate Pole with respect to the International Terrestrial
27742      *      Reference System (see IERS Conventions 2003), measured along the
27743      *      meridians 0 and 90 deg west respectively.  For many
27744      *      applications, xp and yp can be set to zero.
27745      *
27746      *  <li> If hm, the height above the ellipsoid of the observing station
27747      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
27748      *      available, an adequate estimate of hm can be obtained from the
27749      *      expression
27750      *
27751      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
27752      *
27753      *      <p>where tsl is the approximate sea-level air temperature in K
27754      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
27755      *      52).  Similarly, if the pressure phpa is not known, it can be
27756      *      estimated from the height of the observing station, hm, as
27757      *      follows:
27758      *
27759      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
27760      *
27761      *      <p>Note, however, that the refraction is nearly proportional to
27762      *      the pressure and that an accurate phpa value is important for
27763      *      precise work.
27764      *
27765      *  <li> The argument wl specifies the observing wavelength in
27766      *      micrometers.  The transition from optical to radio is assumed to
27767      *      occur at 100 micrometers (about 3000 GHz).
27768      *
27769      *  <li> "Observed" Az,ZD means the position that would be seen by a
27770      *      perfect geodetically aligned theodolite.  (Zenith distance is
27771      *      used rather than altitude in order to reflect the fact that no
27772      *      allowance is made for depression of the horizon.)  This is
27773      *      related to the observed HA,Dec via the standard rotation, using
27774      *      the geodetic latitude (corrected for polar motion), while the
27775      *      observed HA and RA are related simply through the Earth rotation
27776      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
27777      *      means the position that would be seen by a perfect equatorial
27778      *      with its polar axis aligned to the Earth's axis of rotation.
27779      *
27780      *  <li> The accuracy of the result is limited by the corrections for
27781      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
27782      *      Providing the meteorological parameters are known accurately and
27783      *      there are no gross local effects, the predicted astrometric
27784      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
27785      *      (radio) for a zenith distance of less than 70 degrees, better
27786      *      than 30 arcsec (optical or radio) at 85 degrees and better
27787      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
27788      *
27789      *  <li> The complementary functions iauAtio13 and iauAtoi13 are self-
27790      *      consistent to better than 1 microarcsecond all over the
27791      *      celestial sphere.
27792      *
27793      *  <li> It is advisable to take great care with units, as even unlikely
27794      *      values of the input parameters are accepted and processed in
27795      *      accordance with the models used.
27796      *
27797      * </ol>
27798      *  Called:
27799      * <ul>
27800      *     <li>{@link #jauApio13} astrometry parameters, CIRS-observed, 2013
27801      *     <li>{@link #jauAtioq} quick CIRS to observed
27802      *
27803      * </ul>
27804      *@version  2013 October 9
27805      *
27806      *@since JSOFA release 20131202
27807      *
27808      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27809      * @throws JSOFAInternalError an internal error has occured
27810      * @throws JSOFAIllegalParameter unacceptable date.
27811      */
27812     public static ObservedPosition jauAtio13(double ri, double di,
27813             double utc1, double utc2, double dut1,
27814             double elong, double phi, double hm, double xp, double yp,
27815             double phpa, double tc, double rh, double wl) throws JSOFAIllegalParameter, JSOFAInternalError
27816     {
27817         Astrom astrom = new Astrom();
27818 
27819 
27820         /* Star-independent astrometry parameters for CIRS->observed. */
27821         jauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
27822                 phpa, tc, rh, wl, astrom);
27823 
27824         /* Transform CIRS to observed. */
27825         return jauAtioq(ri, di, astrom);
27826 
27827         /* Finished. */
27828 
27829 
27830     }
27831 
27832     /**
27833      *  Quick CIRS to observed place transformation.
27834      *
27835      *  Use of this function is appropriate when efficiency is important and
27836      *  where many star positions are all to be transformed for one date.
27837      *  The star-independent astrometry parameters can be obtained by
27838      *  calling iauApio[13] or iauApco[13].
27839      *
27840      *<p>This function is derived from the International Astronomical Union's
27841      *  SOFA (Standards of Fundamental Astronomy) software collection.
27842      *
27843      *<p>Status:  support function.
27844      *
27845      *<!-- Given: -->
27846      *     @param ri      double      CIRS right ascension
27847      *     @param di      double      CIRS declination
27848      *     @param astrom    star-independent astrometry parameters:
27849      *
27850      *<!-- Returned:-->
27851      *     @return aob     double*      <b>Returned</b> observed azimuth (radians: N=0,E=90)
27852      *             zob     double*      <b>Returned</b> observed zenith distance (radians)
27853      *             hob     double*      <b>Returned</b> observed hour angle (radians)
27854      *             dob     double*      <b>Returned</b> observed declination (radians)
27855      *             rob     double*      <b>Returned</b> observed right ascension (CIO-based, radians)
27856      *
27857      *<p>Notes:
27858      * <ol>
27859      *
27860      *  <li> This function returns zenith distance rather than altitude in
27861      *     order to reflect the fact that no allowance is made for
27862      *     depression of the horizon.
27863      *
27864      *  <li> The accuracy of the result is limited by the corrections for
27865      *     refraction, which use a simple A*tan(z) + B*tan^3(z) model.
27866      *     Providing the meteorological parameters are known accurately and
27867      *     there are no gross local effects, the predicted observed
27868      *     coordinates should be within 0.05 arcsec (optical) or 1 arcsec
27869      *     (radio) for a zenith distance of less than 70 degrees, better
27870      *     than 30 arcsec (optical or radio) at 85 degrees and better
27871      *     than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
27872      *
27873      *     <p>Without refraction, the complementary functions iauAtioq and
27874      *     iauAtoiq are self-consistent to better than 1 microarcsecond all
27875      *     over the celestial sphere.  With refraction included, consistency
27876      *     falls off at high zenith distances, but is still better than
27877      *     0.05 arcsec at 85 degrees.
27878      *
27879      *  <li> It is advisable to take great care with units, as even unlikely
27880      *     values of the input parameters are accepted and processed in
27881      *     accordance with the models used.
27882      *
27883      *  <li> The CIRS RA,Dec is obtained from a star catalog mean place by
27884      *     allowing for space motion, parallax, the Sun's gravitational lens
27885      *     effect, annual aberration and precession-nutation.  For star
27886      *     positions in the ICRS, these effects can be applied by means of
27887      *     the iauAtci13 (etc.) functions.  Starting from classical "mean
27888      *     place" systems, additional transformations will be needed first.
27889      *
27890      *  <li> "Observed" Az,El means the position that would be seen by a
27891      *     perfect geodetically aligned theodolite.  This is obtained from
27892      *     the CIRS RA,Dec by allowing for Earth orientation and diurnal
27893      *     aberration, rotating from equator to horizon coordinates, and
27894      *     then adjusting for refraction.  The HA,Dec is obtained by
27895      *     rotating back into equatorial coordinates, and is the position
27896      *     that would be seen by a perfect equatorial with its polar axis
27897      *     aligned to the Earth's axis of rotation.  Finally, the RA is
27898      *     obtained by subtracting the HA from the local ERA.
27899      *
27900      *  <li> The star-independent CIRS-to-observed-place parameters in ASTROM
27901      *     may be computed with iauApio[13] or iauApco[13].  If nothing has
27902      *     changed significantly except the time, iauAper[13] may be used to
27903      *     perform the requisite adjustment to the astrom structure.
27904      *
27905      * </ol>
27906      *  Called:
27907      * <ul>
27908      *     <li>{@link #jauS2c} spherical coordinates to unit vector
27909      *     <li>{@link #jauC2s} p-vector to spherical
27910      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
27911      *
27912      * </ul>
27913      *@version  2013 December 5
27914      *
27915      *@since JSOFA release 20131202
27916      *
27917      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27918      */
27919     public static ObservedPosition jauAtioq(double ri, double di, Astrom astrom)
27920     {
27921         /* Minimum cos(alt) and sin(alt) for refraction purposes */
27922         final double CELMIN = 1e-6;
27923         final double SELMIN = 0.05;
27924 
27925         double v[] = new double[3], x, y, z, sx, cx, sy, cy, xhd, yhd, zhd, f,
27926           xhdt, yhdt, zhdt, xaet, yaet, zaet, azobs, r, tz, w, del,
27927           cosdel, xaeo, yaeo, zaeo, zdobs, hmobs, dcobs, raobs;
27928 
27929         /*--------------------------------------------------------------------*/
27930 
27931         /* CIRS RA,Dec to Cartesian -HA,Dec. */
27932         v = jauS2c(ri-astrom.eral, di);
27933         x = v[0];
27934         y = v[1];
27935         z = v[2];
27936 
27937         /* Polar motion. */
27938         sx = sin(astrom.xpl);
27939         cx = cos(astrom.xpl);
27940         sy = sin(astrom.ypl);
27941         cy = cos(astrom.ypl);
27942         xhd = cx*x + sx*z;
27943         yhd = sx*sy*x + cy*y - cx*sy*z;
27944         zhd = -sx*cy*x + sy*y + cx*cy*z;
27945 
27946         /* Diurnal aberration. */
27947         f = ( 1.0 - astrom.diurab*yhd );
27948         xhdt = f * xhd;
27949         yhdt = f * ( yhd + astrom.diurab );
27950         zhdt = f * zhd;
27951 
27952         /* Cartesian -HA,Dec to Cartesian Az,El (S=0,E=90). */
27953         xaet = astrom.sphi*xhdt - astrom.cphi*zhdt;
27954         yaet = yhdt;
27955         zaet = astrom.cphi*xhdt + astrom.sphi*zhdt;
27956 
27957         /* Azimuth (N=0,E=90). */
27958         azobs = ( xaet != 0.0 || yaet != 0.0 ) ? atan2(yaet,-xaet) : 0.0;
27959 
27960         /* ---------- */
27961         /* Refraction */
27962         /* ---------- */
27963 
27964         /* Cosine and sine of altitude, with precautions. */
27965         r = sqrt(xaet*xaet + yaet*yaet);
27966         r = r > CELMIN ? r : CELMIN;
27967         z = zaet > SELMIN ? zaet : SELMIN;
27968 
27969         /* A*tan(z)+B*tan^3(z) model, with Newton-Raphson correction. */
27970         tz = r/z;
27971         w = astrom.refb*tz*tz;
27972         del = ( astrom.refa + w ) * tz /
27973                 ( 1.0 + ( astrom.refa + 3.0*w ) / ( z*z ) );
27974 
27975         /* Apply the change, giving observed vector. */
27976         cosdel = 1.0 - del*del/2.0;
27977         f = cosdel - del*z/r;
27978         xaeo = xaet*f;
27979         yaeo = yaet*f;
27980         zaeo = cosdel*zaet + del*r;
27981 
27982         /* Observed ZD. */
27983         zdobs = atan2(sqrt(xaeo*xaeo+yaeo*yaeo), zaeo);
27984 
27985         /* Az/El vector to HA,Dec vector (both right-handed). */
27986         v[0] = astrom.sphi*xaeo + astrom.cphi*zaeo;
27987         v[1] = yaeo;
27988         v[2] = - astrom.cphi*xaeo + astrom.sphi*zaeo;
27989 
27990         /* To spherical -HA,Dec. */
27991         SphericalCoordinate co = jauC2s ( v);
27992         hmobs = co.alpha;
27993         dcobs = co.delta;
27994         /* Right ascension (with respect to CIO). */
27995         raobs = astrom.eral + hmobs;
27996 
27997         /* Return the results. */
27998         return new ObservedPosition(
27999         jauAnp(azobs),
28000         zdobs,
28001         -hmobs,
28002         dcobs,
28003         jauAnp(raobs));
28004 
28005         /* Finished. */
28006 
28007 
28008     }
28009 
28010     /**
28011      *  Observed place at a groundbased site to to ICRS astrometric RA,Dec.
28012      *  The caller supplies UTC, site coordinates, ambient air conditions
28013      *  and observing wavelength.
28014      *
28015      *<p>This function is derived from the International Astronomical Union's
28016      *  SOFA (Standards of Fundamental Astronomy) software collection.
28017      *
28018      *<p>Status:  support function.
28019      *
28020      *<!-- Given: -->
28021      *     @param type    char[]    type of coordinates - "R", "H" or "A" (Notes 1,2)
28022      *     @param ob1     double    observed Az, HA or RA (radians; Az is N=0,E=90)
28023      *     @param ob2     double    observed ZD or Dec (radians)
28024      *     @param utc1    double    UTC as a 2-part...
28025      *     @param utc2    double    ...quasi Julian Date (Notes 3,4)
28026      *     @param dut1    double    UT1-UTC (seconds, Note 5)
28027      *     @param elong   double    longitude (radians, east +ve, Note 6)
28028      *     @param phi     double    geodetic latitude (radians, Note 6)
28029      *     @param hm      double    height above ellipsoid (m, geodetic Notes 6,8)
28030      *     @param xp double    polar motion coordinates (radians, Note 7)
28031      *     @param yp double    polar motion coordinates (radians, Note 7) 
28032      *     @param phpa    double    pressure at the observer (hPa = mB, Note 8)
28033      *     @param tc      double    ambient temperature at the observer (deg C)
28034      *     @param rh      double    relative humidity at the observer (range 0-1)
28035      *     @param wl      double    wavelength (micrometers, Note 9)
28036      *
28037      *<!-- Returned:-->
28038      *     @return rc,dc   double     <b>Returned</b> ICRS astrometric RA,Dec (radians)
28039      *
28040      *  @throws JSOFAInternalError an internal error has occured
28041      *  @throws JSOFAIllegalParameter int       status:   <b>Returned</b> +1 = dubious year (Note 4)
28042      *                               0  =   <b>Returned</b> OK
28043      *                              -1  =   <b>Returned</b> unacceptable date
28044      *
28045      *<p>Notes:
28046      * <ol>
28047      *
28048      *  <li> "Observed" Az,ZD means the position that would be seen by a
28049      *      perfect geodetically aligned theodolite.  (Zenith distance is
28050      *      used rather than altitude in order to reflect the fact that no
28051      *      allowance is made for depression of the horizon.)  This is
28052      *      related to the observed HA,Dec via the standard rotation, using
28053      *      the geodetic latitude (corrected for polar motion), while the
28054      *      observed HA and RA are related simply through the Earth rotation
28055      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
28056      *      means the position that would be seen by a perfect equatorial
28057      *      with its polar axis aligned to the Earth's axis of rotation.
28058      *
28059      *  <li> Only the first character of the type argument is significant.
28060      *      "R" or "r" indicates that ob1 and ob2 are the observed right
28061      *      ascension and declination;  "H" or "h" indicates that they are
28062      *      hour angle (west +ve) and declination;  anything else ("A" or
28063      *      "a" is recommended) indicates that ob1 and ob2 are azimuth
28064      *      (north zero, east 90 deg) and zenith distance.
28065      *
28066      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
28067      *      convenient way between the two arguments, for example where utc1
28068      *      is the Julian Day Number and utc2 is the fraction of a day.
28069      *
28070      *      <p>However, JD cannot unambiguously represent UTC during a leap
28071      *      second unless special measures are taken.  The convention in the
28072      *      present function is that the JD day represents UTC days whether
28073      *      the length is 86399, 86400 or 86401 SI seconds.
28074      *
28075      *      <p>Applications should use the function iauDtf2d to convert from
28076      *      calendar date and time of day into 2-part quasi Julian Date, as
28077      *      it implements the leap-second-ambiguity convention just
28078      *      described.
28079      *
28080      *  <li> The warning status "dubious year" flags UTCs that predate the
28081      *      introduction of the time scale or that are too far in the
28082      *      future to be trusted.  See iauDat for further details.
28083      *
28084      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
28085      *      one second at the end of each positive UTC leap second,
28086      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
28087      *      practice is under review, and in the future UT1-UTC may grow
28088      *      essentially without limit.
28089      *
28090      *  <li> The geographical coordinates are with respect to the WGS84
28091      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
28092      *      longitude required by the present function is east-positive
28093      *      (i.e. right-handed), in accordance with geographical convention.
28094      *
28095      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
28096      *      values are the coordinates (in radians) of the Celestial
28097      *      Intermediate Pole with respect to the International Terrestrial
28098      *      Reference System (see IERS Conventions 2003), measured along the
28099      *      meridians 0 and 90 deg west respectively.  For many
28100      *      applications, xp and yp can be set to zero.
28101      *
28102      *  <li> If hm, the height above the ellipsoid of the observing station
28103      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
28104      *      available, an adequate estimate of hm can be obtained from the
28105      *      expression
28106      *
28107      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
28108      *
28109      *      <p>where tsl is the approximate sea-level air temperature in K
28110      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
28111      *      52).  Similarly, if the pressure phpa is not known, it can be
28112      *      estimated from the height of the observing station, hm, as
28113      *      follows:
28114      *
28115      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
28116      *
28117      *      <p>Note, however, that the refraction is nearly proportional to
28118      *      the pressure and that an accurate phpa value is important for
28119      *      precise work.
28120      *
28121      *  <li> The argument wl specifies the observing wavelength in
28122      *      micrometers.  The transition from optical to radio is assumed to
28123      *      occur at 100 micrometers (about 3000 GHz).
28124      *
28125      *  <li> The accuracy of the result is limited by the corrections for
28126      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
28127      *      Providing the meteorological parameters are known accurately and
28128      *      there are no gross local effects, the predicted astrometric
28129      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
28130      *      (radio) for a zenith distance of less than 70 degrees, better
28131      *      than 30 arcsec (optical or radio) at 85 degrees and better
28132      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
28133      *
28134      *      <p>Without refraction, the complementary functions iauAtco13 and
28135      *      iauAtoc13 are self-consistent to better than 1 microarcsecond
28136      *      all over the celestial sphere.  With refraction included,
28137      *      consistency falls off at high zenith distances, but is still
28138      *      better than 0.05 arcsec at 85 degrees.
28139      *
28140      *  <li> It is advisable to take great care with units, as even unlikely
28141      *      values of the input parameters are accepted and processed in
28142      *      accordance with the models used.
28143      *
28144      * </ol>
28145      *  Called:
28146      * <ul>
28147      *     <li>{@link #jauApco13} astrometry parameters, ICRS-observed
28148      *     <li>{@link #jauAtoiq} quick observed to CIRS
28149      *     <li>{@link #jauAticq} quick CIRS to ICRS
28150      *
28151      * </ul>
28152      *@version  2013 October 9
28153      *
28154      *@since JSOFA release 20131202
28155      *
28156      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28157      * @throws JSOFAInternalError an internal error has occured
28158      * @throws JSOFAIllegalParameter unacceptable date.
28159      */
28160     public static SphericalCoordinate jauAtoc13(String type, double ob1, double ob2,
28161             double utc1, double utc2, double dut1,
28162             double elong, double phi, double hm, double xp, double yp,
28163             double phpa, double tc, double rh, double wl
28164             ) throws JSOFAIllegalParameter, JSOFAInternalError
28165     {
28166         Astrom astrom = new Astrom();
28167         jauApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
28168                 phpa, tc, rh, wl, astrom);
28169 
28170         /* Transform observed to CIRS. */
28171         SphericalCoordinate co = jauAtoiq(type, ob1, ob2, astrom);
28172 
28173         /* Transform CIRS to ICRS. */
28174         SphericalCoordinate icrs = jauAticq(co.alpha, co.delta, astrom);
28175         return icrs;
28176        
28177 
28178         /* Finished. */
28179 
28180 
28181     }
28182 
28183     /**
28184      *  Observed place to CIRS.  The caller supplies UTC, site coordinates,
28185      *  ambient air conditions and observing wavelength.
28186      *
28187      *<p>This function is derived from the International Astronomical Union's
28188      *  SOFA (Standards of Fundamental Astronomy) software collection.
28189      *
28190      *<p>Status:  support function.
28191      *
28192      *<!-- Given: -->
28193      *     @param type    char[]    type of coordinates - "R", "H" or "A" (Notes 1,2)
28194      *     @param ob1     double    observed Az, HA or RA (radians; Az is N=0,E=90)
28195      *     @param ob2     double    observed ZD or Dec (radians)
28196      *     @param utc1    double    UTC as a 2-part...
28197      *     @param utc2    double    ...quasi Julian Date (Notes 3,4)
28198      *     @param dut1    double    UT1-UTC (seconds, Note 5)
28199      *     @param elong   double    longitude (radians, east +ve, Note 6)
28200      *     @param phi     double    geodetic latitude (radians, Note 6)
28201      *     @param hm      double    height above the ellipsoid (meters, Notes 6,8)
28202      *     @param xp double    polar motion coordinates (radians, Note 7)
28203      *     @param yp double    polar motion coordinates (radians, Note 7) 
28204      *     @param phpa    double    pressure at the observer (hPa = mB, Note 8)
28205      *     @param tc      double    ambient temperature at the observer (deg C)
28206      *     @param rh      double    relative humidity at the observer (range 0-1)
28207      *     @param wl      double    wavelength (micrometers, Note 9)
28208      *
28209      *<!-- Returned:-->
28210      *     @return ri      double*    <b>Returned</b> CIRS right ascension (CIO-based, radians)
28211      *             di      double*    <b>Returned</b> CIRS declination (radians)
28212      *
28213      *  @throws JSOFAInternalError an internal error has occured
28214      *  @throws JSOFAIllegalParameter int       status:   <b>Returned</b> +1 = dubious year (Note 2)
28215      *                               0  =   <b>Returned</b> OK
28216      *                              -1  =   <b>Returned</b> unacceptable date
28217      *
28218      *<p>Notes:
28219      * <ol>
28220      *
28221      *  <li> "Observed" Az,ZD means the position that would be seen by a
28222      *      perfect geodetically aligned theodolite.  (Zenith distance is
28223      *      used rather than altitude in order to reflect the fact that no
28224      *      allowance is made for depression of the horizon.)  This is
28225      *      related to the observed HA,Dec via the standard rotation, using
28226      *      the geodetic latitude (corrected for polar motion), while the
28227      *      observed HA and RA are related simply through the Earth rotation
28228      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
28229      *      means the position that would be seen by a perfect equatorial
28230      *      with its polar axis aligned to the Earth's axis of rotation.
28231      *
28232      *  <li> Only the first character of the type argument is significant.
28233      *      "R" or "r" indicates that ob1 and ob2 are the observed right
28234      *      ascension and declination;  "H" or "h" indicates that they are
28235      *      hour angle (west +ve) and declination;  anything else ("A" or
28236      *      "a" is recommended) indicates that ob1 and ob2 are azimuth
28237      *      (north zero, east 90 deg) and zenith distance.
28238      *
28239      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
28240      *      convenient way between the two arguments, for example where utc1
28241      *      is the Julian Day Number and utc2 is the fraction of a day.
28242      *
28243      *      <p>However, JD cannot unambiguously represent UTC during a leap
28244      *      second unless special measures are taken.  The convention in the
28245      *      present function is that the JD day represents UTC days whether
28246      *      the length is 86399, 86400 or 86401 SI seconds.
28247      *
28248      *      <p>Applications should use the function iauDtf2d to convert from
28249      *      calendar date and time of day into 2-part quasi Julian Date, as
28250      *      it implements the leap-second-ambiguity convention just
28251      *      described.
28252      *
28253      *  <li> The warning status "dubious year" flags UTCs that predate the
28254      *      introduction of the time scale or that are too far in the
28255      *      future to be trusted.  See iauDat for further details.
28256      *
28257      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
28258      *      one second at the end of each positive UTC leap second,
28259      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
28260      *      practice is under review, and in the future UT1-UTC may grow
28261      *      essentially without limit.
28262      *
28263      *  <li> The geographical coordinates are with respect to the WGS84
28264      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
28265      *      longitude required by the present function is east-positive
28266      *      (i.e. right-handed), in accordance with geographical convention.
28267      *
28268      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
28269      *      values are the coordinates (in radians) of the Celestial
28270      *      Intermediate Pole with respect to the International Terrestrial
28271      *      Reference System (see IERS Conventions 2003), measured along the
28272      *      meridians 0 and 90 deg west respectively.  For many
28273      *      applications, xp and yp can be set to zero.
28274      *
28275      *  <li> If hm, the height above the ellipsoid of the observing station
28276      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
28277      *      available, an adequate estimate of hm can be obtained from the
28278      *      expression
28279      *
28280      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
28281      *
28282      *      <p>where tsl is the approximate sea-level air temperature in K
28283      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
28284      *      52).  Similarly, if the pressure phpa is not known, it can be
28285      *      estimated from the height of the observing station, hm, as
28286      *      follows:
28287      *
28288      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
28289      *
28290      *      <p>Note, however, that the refraction is nearly proportional to
28291      *      the pressure and that an accurate phpa value is important for
28292      *      precise work.
28293      *
28294      *  <li> The argument wl specifies the observing wavelength in
28295      *      micrometers.  The transition from optical to radio is assumed to
28296      *      occur at 100 micrometers (about 3000 GHz).
28297      *
28298      *  <li> The accuracy of the result is limited by the corrections for
28299      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
28300      *      Providing the meteorological parameters are known accurately and
28301      *      there are no gross local effects, the predicted astrometric
28302      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
28303      *      (radio) for a zenith distance of less than 70 degrees, better
28304      *      than 30 arcsec (optical or radio) at 85 degrees and better
28305      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
28306      *
28307      *      <p>Without refraction, the complementary functions iauAtio13 and
28308      *      iauAtoi13 are self-consistent to better than 1 microarcsecond
28309      *      all over the celestial sphere.  With refraction included,
28310      *      consistency falls off at high zenith distances, but is still
28311      *      better than 0.05 arcsec at 85 degrees.
28312      *
28313      *  <li> It is advisable to take great care with units, as even unlikely
28314      *      values of the input parameters are accepted and processed in
28315      *      accordance with the models used.
28316      *
28317      * </ol>
28318      *  Called:
28319      * <ul>
28320      *     <li>{@link #jauApio13} astrometry parameters, CIRS-observed, 2013
28321      *     <li>{@link #jauAtoiq} quick observed to CIRS
28322      *
28323      * </ul>
28324      *@version  2013 October 9
28325      *
28326      *@since JSOFA release 20131202
28327      *
28328      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28329      * @throws JSOFAInternalError an internal error has occured
28330      * @throws JSOFAIllegalParameter unacceptable date.
28331      */
28332     public static SphericalCoordinate jauAtoi13(String type, double ob1, double ob2,
28333             double utc1, double utc2, double dut1,
28334             double elong, double phi, double hm, double xp, double yp,
28335             double phpa, double tc, double rh, double wl
28336             ) throws JSOFAIllegalParameter, JSOFAInternalError
28337     {
28338         Astrom astrom = new Astrom();
28339 
28340 
28341         /* Star-independent astrometry parameters for CIRS->observed. */
28342         jauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
28343                 phpa, tc, rh, wl, astrom);
28344 
28345         /* Transform observed to CIRS. */
28346         SphericalCoordinate co = jauAtoiq(type, ob1, ob2, astrom);
28347         return co;
28348         
28349         /* Finished. */
28350 
28351 
28352     }
28353 
28354     /**
28355      *  Quick observed place to CIRS, given the star-independent astrometry
28356      *  parameters.
28357      * 
28358      *  Use of this function is appropriate when efficiency is important and
28359      *  where many star positions are all to be transformed for one date.
28360      *  The star-independent astrometry parameters can be obtained by
28361      *  calling iauApio[13] or iauApco[13].
28362      *
28363      *<p>Status:  support function.
28364      *
28365      *<!-- Given: -->
28366      *     @param type    char[]      type of coordinates: "R", "H" or "A" (Note 1)
28367      *     @param ob1     double      observed Az, HA or RA (radians; Az is N=0,E=90)
28368      *     @param ob2     double      observed ZD or Dec (radians)
28369      *     @param astrom    star-independent astrometry parameters:
28370      *
28371      *<!-- Returned:-->
28372      *     @return ri      double*      <b>Returned</b> CIRS right ascension (CIO-based, radians)
28373      *             di      double*      <b>Returned</b> CIRS declination (radians)
28374      *
28375      *<p>Notes:
28376      * <ol>
28377      *
28378      *  <li> "Observed" Az,ZD means the position that would be seen by a
28379      *     perfect geodetically aligned theodolite.  This is related to
28380      *     the observed HA,Dec via the standard rotation, using the geodetic
28381      *     latitude (corrected for polar motion), while the observed HA and
28382      *     RA are related simply through the Earth rotation angle and the
28383      *     site longitude.  "Observed" RA,Dec or HA,Dec thus means the
28384      *     position that would be seen by a perfect equatorial with its
28385      *     polar axis aligned to the Earth's axis of rotation.  By removing
28386      *     from the observed place the effects of atmospheric refraction and
28387      *     diurnal aberration, the CIRS RA,Dec is obtained.
28388      *
28389      *  <li> Only the first character of the type argument is significant.
28390      *     "R" or "r" indicates that ob1 and ob2 are the observed right
28391      *     ascension and declination;  "H" or "h" indicates that they are
28392      *     hour angle (west +ve) and declination;  anything else ("A" or
28393      *     "a" is recommended) indicates that ob1 and ob2 are azimuth (north
28394      *     zero, east 90 deg) and zenith distance.  (Zenith distance is used
28395      *     rather than altitude in order to reflect the fact that no
28396      *     allowance is made for depression of the horizon.)
28397      *
28398      *  <li> The accuracy of the result is limited by the corrections for
28399      *     refraction, which use a simple A*tan(z) + B*tan^3(z) model.
28400      *     Providing the meteorological parameters are known accurately and
28401      *     there are no gross local effects, the predicted intermediate
28402      *     coordinates should be within 0.05 arcsec (optical) or 1 arcsec
28403      *     (radio) for a zenith distance of less than 70 degrees, better
28404      *     than 30 arcsec (optical or radio) at 85 degrees and better than
28405      *     20 arcmin (optical) or 25 arcmin (radio) at the horizon.
28406      *
28407      *     <p>Without refraction, the complementary functions iauAtioq and
28408      *     iauAtoiq are self-consistent to better than 1 microarcsecond all
28409      *     over the celestial sphere.  With refraction included, consistency
28410      *     falls off at high zenith distances, but is still better than
28411      *     0.05 arcsec at 85 degrees.
28412      *
28413      *  <li> It is advisable to take great care with units, as even unlikely
28414      *     values of the input parameters are accepted and processed in
28415      *     accordance with the models used.
28416      *
28417      * </ol>
28418      *  Called:
28419      * <ul>
28420      *     <li>{@link #jauS2c} spherical coordinates to unit vector
28421      *     <li>{@link #jauC2s} p-vector to spherical
28422      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
28423      *
28424      * </ul>
28425      *@version  2013 October 9
28426      *
28427      *@since JSOFA release 20131202
28428      *
28429      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28430      */
28431     public static SphericalCoordinate jauAtoiq(String type,
28432             double ob1, double ob2, Astrom astrom
28433             )
28434     {
28435         /** Minimum sin(alt) for refraction purposes */
28436         final double SELMIN = 0.05;
28437         char c;
28438         double c1, c2, sphi, cphi, ce, xaeo, yaeo, zaeo, v[] = new double[3],
28439         xmhdo, ymhdo, zmhdo, az, sz, zdo, refa, refb, tz, dref,
28440         zdt, xaet, yaet, zaet, xmhda, ymhda, zmhda,
28441         f, xhd, yhd, zhd, sx, cx, sy, cy;
28442 
28443 
28444         /* Coordinate type. */
28445         c = type.charAt(0);
28446 
28447         /* Coordinates. */
28448         c1 = ob1;
28449         c2 = ob2;
28450 
28451         /* Sin, cos of latitude. */
28452         sphi = astrom.sphi;
28453         cphi = astrom.cphi;
28454 
28455         /* Standardize coordinate type. */
28456         if ( c == 'r' || c == 'R' ) {
28457             c = 'R';
28458         } else if ( c == 'h' || c == 'H' ) {
28459             c = 'H';
28460         } else {
28461             c = 'A';
28462         }
28463 
28464         /* If Az,ZD, convert to Cartesian (S=0,E=90). */
28465         if ( c == 'A' ) {
28466             ce = sin(c2);
28467             xaeo = - cos(c1) * ce;
28468             yaeo = sin(c1) * ce;
28469             zaeo = cos(c2);
28470 
28471         } else {
28472 
28473             /* If RA,Dec, convert to HA,Dec. */
28474             if ( c == 'R' ) c1 = astrom.eral - c1;
28475 
28476             /* To Cartesian -HA,Dec. */
28477             v = jauS2c ( -c1, c2 );
28478             xmhdo = v[0];
28479             ymhdo = v[1];
28480             zmhdo = v[2];
28481 
28482             /* To Cartesian Az,El (S=0,E=90). */
28483             xaeo = sphi*xmhdo - cphi*zmhdo;
28484             yaeo = ymhdo;
28485             zaeo = cphi*xmhdo + sphi*zmhdo;
28486         }
28487 
28488         /* Azimuth (S=0,E=90). */
28489         az = ( xaeo != 0.0 || yaeo != 0.0 ) ? atan2(yaeo,xaeo) : 0.0;
28490 
28491         /* Sine of observed ZD, and observed ZD. */
28492         sz = sqrt ( xaeo*xaeo + yaeo*yaeo );
28493         zdo = atan2 ( sz, zaeo );
28494 
28495         /*
28496          * Refraction
28497          * ----------
28498          */
28499 
28500         /* Fast algorithm using two constant model. */
28501         refa = astrom.refa;
28502         refb = astrom.refb;
28503         tz = sz / ( zaeo > SELMIN ? zaeo : SELMIN );
28504         dref = ( refa + refb*tz*tz ) * tz;
28505         zdt = zdo + dref;
28506 
28507         /* To Cartesian Az,ZD. */
28508         ce = sin(zdt);
28509         xaet = cos(az) * ce;
28510         yaet = sin(az) * ce;
28511         zaet = cos(zdt);
28512 
28513         /* Cartesian Az,ZD to Cartesian -HA,Dec. */
28514         xmhda = sphi*xaet + cphi*zaet;
28515         ymhda = yaet;
28516         zmhda = - cphi*xaet + sphi*zaet;
28517 
28518         /* Diurnal aberration. */
28519         f = ( 1.0 + astrom.diurab*ymhda );
28520         xhd = f * xmhda;
28521         yhd = f * ( ymhda - astrom.diurab );
28522         zhd = f * zmhda;
28523 
28524         /* Polar motion. */
28525         sx = sin(astrom.xpl);
28526         cx = cos(astrom.xpl);
28527         sy = sin(astrom.ypl);
28528         cy = cos(astrom.ypl);
28529         v[0] = cx*xhd + sx*sy*yhd - sx*cy*zhd;
28530         v[1] = cy*yhd + sy*zhd;
28531         v[2] = sx*xhd - cx*sy*yhd + cx*cy*zhd;
28532 
28533         /* To spherical -HA,Dec. */
28534         SphericalCoordinate co = jauC2s(v);
28535 
28536         /* Right ascension. */
28537         co.alpha = jauAnp(astrom.eral + co.alpha);
28538 
28539         return co;
28540         /* Finished. */
28541 
28542 
28543     }
28544 
28545     /**
28546      *  Apply light deflection by a solar-system body, as part of
28547      *  transforming coordinate direction into natural direction.
28548      *
28549      *<p>This function is derived from the International Astronomical Union's
28550      *  SOFA (Standards of Fundamental Astronomy) software collection.
28551      *
28552      *<p>Status:  support function.
28553      *
28554      *<!-- Given: -->
28555      *     @param bm      double      mass of the gravitating body (solar masses)
28556      *     @param p       double[3]   direction from observer to source (unit vector)
28557      *     @param q       double[3]   direction from body to source (unit vector)
28558      *     @param e       double[3]   direction from body to observer (unit vector)
28559      *     @param em      double      distance from body to observer (au)
28560      *     @param dlim    double      deflection limiter (Note 4)
28561      *
28562      *<!-- Returned:-->
28563      *     @return p1      double[3]    <b>Returned</b> observer to deflected source (unit vector)
28564      *
28565      *<p>Notes:
28566      * <ol>
28567      *
28568      *  <li> The algorithm is based on Expr. (70) in Klioner (2003) and
28569      *     Expr. (7.63) in the Explanatory Supplement (Urban &amp; Seidelmann
28570      *     2013), with some rearrangement to minimize the effects of machine
28571      *     precision.
28572      *
28573      *  <li> The mass parameter bm can, as required, be adjusted in order to
28574      *     allow for such effects as quadrupole field.
28575      *
28576      *  <li> The barycentric position of the deflecting body should ideally
28577      *     correspond to the time of closest approach of the light ray to
28578      *     the body.
28579      *
28580      *  <li> The deflection limiter parameter dlim is phi^2/2, where phi is
28581      *     the angular separation (in radians) between source and body at
28582      *     which limiting is applied.  As phi shrinks below the chosen
28583      *     threshold, the deflection is artificially reduced, reaching zero
28584      *     for phi = 0.
28585      *
28586      *  <li> The returned vector p1 is not normalized, but the consequential
28587      *     departure from unit magnitude is always negligible.
28588      *
28589      *  <li> The arguments p and p1 can be the same array.
28590      *
28591      *  <li> To accumulate total light deflection taking into account the
28592      *     contributions from several bodies, call the present function for
28593      *     each body in succession, in decreasing order of distance from the
28594      *     observer.
28595      *
28596      *  <li> For efficiency, validation is omitted.  The supplied vectors must
28597      *     be of unit magnitude, and the deflection limiter non-zero and
28598      *     positive.
28599      *
28600      * </ol>
28601      *<p>References:
28602      * <ul>
28603      *
28604      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
28605      *     the Astronomical Almanac, 3rd ed., University Science Books
28606      *     (2013).
28607      *
28608      * <li> Klioner, Sergei A., "A practical relativistic model for micro-
28609      *     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
28610      *
28611      * </ul>
28612      *  Called:
28613      * <ul>
28614      *     <li>{@link #jauPdp} scalar product of two p-vectors
28615      *     <li>{@link #jauPxp} vector product of two p-vectors
28616      *
28617      * </ul>
28618      *@version  2013 October 9
28619      *
28620      *@since JSOFA release 20131202
28621      *
28622      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28623      */
28624     public static double[] jauLd(double bm, double p[], double q[], double e[],
28625             double em, double dlim)
28626     {
28627         int i;
28628         double qpe[] = new double[3], qdqpe, w, eq[], peq[] ;
28629 
28630         double p1[] = new double[3];
28631 
28632         /* q . (q + e). */
28633         for (i = 0; i < 3; i++) {
28634             qpe[i] = q[i] + e[i];
28635         }
28636         qdqpe = jauPdp(q, qpe);
28637 
28638         /* 2 x G x bm / ( em x c^2 x ( q . (q + e) ) ). */
28639         w = bm * SRS / em / max(qdqpe,dlim);
28640 
28641         /* p x (e x q). */
28642         eq = jauPxp(e, q);
28643         peq = jauPxp(p, eq);
28644 
28645         /* Apply the deflection. */
28646         for (i = 0; i < 3; i++) {
28647             p1[i] = p[i] + w*peq[i];
28648         }
28649 
28650         return p1;
28651         /* Finished. */
28652 
28653 
28654     }
28655 
28656     /*+
28657      *  - - - - - - -
28658      *   i a u L d n
28659      *  - - - - - - -
28660      *
28661      *  For a star, apply light deflection by multiple solar-system bodies,
28662      *  as part of transforming coordinate direction into natural direction.
28663      *
28664      *<p>This function is derived from the International Astronomical Union's
28665      *  SOFA (Standards of Fundamental Astronomy) software collection.
28666      *
28667      *<p>Status:  support function.
28668      *
28669      *<!-- Given: -->
28670      *     n    int           number of bodies (note 1)
28671      *     b    jauLDBODY[n]  data for each of the n bodies (Notes 1,2):
28672      *      bm   double         mass of the body (solar masses, Note 3)
28673      *      dl   double         deflection limiter (Note 4)
28674      *      pv   [2][3]         barycentric PV of the body (au, au/day)
28675      *     ob   double[3]     barycentric position of the observer (au)
28676      *     sc   double[3]     observer to star coord direction (unit vector)
28677      *
28678      *<!-- Returned:-->
28679      *     sn    double[3]      observer to deflected star (unit vector)
28680      *
28681      *  <li> The array b contains n entries, one for each body to be
28682      *     considered.  If n = 0, no gravitational light deflection will be
28683      *     applied, not even for the Sun.
28684      *
28685      *  <li> The array b should include an entry for the Sun as well as for
28686      *     any planet or other body to be taken into account.  The entries
28687      *     should be in the order in which the light passes the body.
28688      *
28689      *  <li> In the entry in the b array for body i, the mass parameter
28690      *     b[i].bm can, as required, be adjusted in order to allow for such
28691      *     effects as quadrupole field.
28692      *
28693      *  <li> The deflection limiter parameter b[i].dl is phi^2/2, where phi is
28694      *     the angular separation (in radians) between star and body at
28695      *     which limiting is applied.  As phi shrinks below the chosen
28696      *     threshold, the deflection is artificially reduced, reaching zero
28697      *     for phi = 0.   Example values suitable for a terrestrial
28698      *     observer, together with masses, are as follows:
28699      *
28700      *        body i     b[i].bm        b[i].dl
28701      *
28702      *        Sun        1.0            6e-6
28703      *        Jupiter    0.00095435     3e-9
28704      *        Saturn     0.00028574     3e-10
28705      *
28706      *  <li> For cases where the starlight passes the body before reaching the
28707      *     observer, the body is placed back along its barycentric track by
28708      *     the light time from that point to the observer.  For cases where
28709      *     the body is "behind" the observer no such shift is applied.  If
28710      *     a different treatment is preferred, the user has the option of
28711      *     instead using the iauLd function.  Similarly, iauLd can be used
28712      *     for cases where the source is nearby, not a star.
28713      *
28714      *  <li> The returned vector sn is not normalized, but the consequential
28715      *     departure from unit magnitude is always negligible.
28716      *
28717      *  <li> The arguments sc and sn can be the same array.
28718      *
28719      *  <li> For efficiency, validation is omitted.  The supplied masses must
28720      *     be greater than zero, the position and velocity vectors must be
28721      *     right, and the deflection limiter greater than zero.
28722      *
28723      *  Reference:
28724      *
28725      *     Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
28726      *     the Astronomical Almanac, 3rd ed., University Science Books
28727      *     (2013), Section 7.2.4.
28728      *
28729      *  Called:
28730      *     iauCp        copy p-vector
28731      *     iauPdp       scalar product of two p-vectors
28732      *     iauPmp       p-vector minus p-vector
28733      *     iauPpsp      p-vector plus scaled p-vector
28734      *     iauPn        decompose p-vector into modulus and direction
28735      *     iauLd        light deflection by a solar-system body
28736      *
28737      *@version  2013 October 9
28738      *
28739      *@since JSOFA release 20131202
28740      *
28741      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28742      */
28743     public static double[] jauLdn(int n, Ldbody b[], double ob[], double sc[])
28744     {
28745         /* Light time for 1 au (days) */
28746         final double CR = AULT/DAYSEC;
28747 
28748         int i;
28749         double v[] , dt, ev[], sn[] = new double[3];
28750 
28751 
28752         /* Star direction prior to deflection. */
28753         jauCp(sc, sn);
28754 
28755         /* Body by body. */
28756         for ( i = 0; i < n; i++ ) {
28757 
28758             /* Body to observer vector at epoch of observation (au). */
28759             v = jauPmp( ob, b[i].pv[0]);
28760 
28761             /* Minus the time since the light passed the body (days). */
28762             dt = jauPdp(sn,v) * CR;
28763 
28764             /* Neutralize if the star is "behind" the observer. */
28765             dt = min(dt, 0.0);
28766 
28767             /* Backtrack the body to the time the light was passing the body. */
28768             ev = jauPpsp(v, -dt, b[i].pv[1]);
28769 
28770             /* Body to observer vector as magnitude and direction. */
28771             NormalizedVector nv = jauPn(ev);
28772             
28773             /* Apply light deflection for this body. */
28774             sn = jauLd( b[i].bm, sn, sn, nv.u, nv.r, b[i].dl );
28775 
28776             /* Next body. */
28777         }
28778         return sn;
28779 
28780         /* Finished. */
28781 
28782 
28783     }
28784 
28785     /**
28786      *   Deflection of starlight by the Sun.
28787      *
28788      *<p>This function is derived from the International Astronomical Union's
28789      *  SOFA (Standards of Fundamental Astronomy) software collection.
28790      *
28791      *<p>Status:  support function.
28792      *
28793      *<!-- Given: -->
28794      *     @param p       double[3]   direction from observer to star (unit vector)
28795      *     @param e       double[3]   direction from Sun to observer (unit vector)
28796      *     @param em      double      distance from Sun to observer (au)
28797      *
28798      *<!-- Returned:-->
28799      *     @return p1      double[3]    <b>Returned</b> observer to deflected start (unit vector)
28800      *
28801      *<p>Notes:
28802      * <ol>
28803      *
28804      *  <li> The source is presumed to be sufficiently distant that its
28805      *     directions seen from the Sun and the observer are essentially
28806      *     the same.
28807      *
28808      *  <li> The deflection is restrained when the angle between the star and
28809      *     the center of the Sun is less than a threshold value, falling to
28810      *     zero deflection for zero separation.  The chosen threshold value
28811      *     is within the solar limb for all solar-system applications, and
28812      *     is about 5 arcminutes for the case of a terrestrial observer.
28813      *
28814      *  <li> The arguments p and p1 can be the same array.
28815      *
28816      * </ol>
28817      *  Called:
28818      * <ul>
28819      *     <li>{@link #jauLd} light deflection by a solar-system body
28820      *
28821      * </ul>
28822      *@version  2016 July 29
28823      *
28824      *@since JSOFA release 20131202
28825      *
28826      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28827      */
28828     public static double[] jauLdsun(double p[], double e[], double em)
28829     {
28830         double em2, dlim;
28831 
28832 
28833         /* Deflection limiter (smaller for distant observers). */
28834         em2 = em*em;
28835         if ( em2 < 1.0 ) em2 = 1.0;
28836         dlim = 1e-6 / (em2 > 1.0 ? em2 : 1.0);
28837         
28838         /* Apply the deflection. */
28839         return jauLd(1.0, p, p, e, em, dlim);
28840 
28841     }
28842 
28843     /**
28844      *  Proper motion and parallax.
28845      *
28846      *<p>This function is derived from the International Astronomical Union's
28847      *  SOFA (Standards of Fundamental Astronomy) software collection.
28848      *
28849      *<p>Status:  support function.
28850      *
28851      *<!-- Given: -->
28852      *     @param rc double      ICRS RA,Dec at catalog epoch (radians)
28853      *     @param dc double      ICRS RA,Dec at catalog epoch (radians) 
28854      *     @param pr      double      RA proper motion (radians/year; Note 1)
28855      *     @param pd      double      Dec proper motion (radians/year)
28856      *     @param px      double      parallax (arcsec)
28857      *     @param rv      double      radial velocity (km/s, +ve if receding)
28858      *     @param pmt     double      proper motion time interval (SSB, Julian years)
28859      *     @param pob     double[3]   SSB to observer vector (au)
28860      *
28861      *<!-- Returned:-->
28862      *     @return pco     double[3]    <b>Returned</b> coordinate direction (BCRS unit vector)
28863      *
28864      *<p>Notes:
28865      * <ol>
28866      *
28867      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
28868      *
28869      *  <li> The proper motion time interval is for when the starlight
28870      *     reaches the solar system barycenter.
28871      *
28872      *  <li> To avoid the need for iteration, the Roemer effect (i.e. the
28873      *     small annual modulation of the proper motion coming from the
28874      *     changing light time) is applied approximately, using the
28875      *     direction of the star at the catalog epoch.
28876      *
28877      * </ol>
28878      *<p>References:
28879      * <ul>
28880      *
28881      * <li> 1984 Astronomical Almanac, pp B39-B41.
28882      *
28883      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
28884      *     the Astronomical Almanac, 3rd ed., University Science Books
28885      *     (2013), Section 7.2.
28886      *
28887      * </ul>
28888      *  Called:
28889      * <ul>
28890      *     <li>{@link #jauPdp} scalar product of two p-vectors
28891      *     <li>{@link #jauPn} decompose p-vector into modulus and direction
28892      *
28893      * </ul>
28894      *@version  2013 October 9
28895      *
28896      *@since JSOFA release 20131202
28897      *
28898      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28899      */
28900     public static double[] jauPmpx(double rc, double dc, double pr, double pd,
28901             double px, double rv, double pmt, double pob[]
28902             )
28903     {
28904         /* Km/s to au/year */
28905         final double VF = DAYSEC*DJM/DAU;
28906 
28907         /* Light time for 1 au, Julian years */
28908         final double AULTY = AULT/DAYSEC/DJY;
28909 
28910         int i;
28911         double sr, cr, sd, cd, x, y, z, p[] = new double[3], dt, pxr, w, pdz, pm[] = new double[3];
28912 
28913 
28914         /* Spherical coordinates to unit vector (and useful functions). */
28915         sr = sin(rc);
28916         cr = cos(rc);
28917         sd = sin(dc);
28918         cd = cos(dc);
28919         p[0] = x = cr*cd;
28920         p[1] = y = sr*cd;
28921         p[2] = z = sd;
28922 
28923         /* Proper motion time interval (y) including Roemer effect. */
28924         dt = pmt + jauPdp(p,pob)*AULTY;
28925 
28926         /* Space motion (radians per year). */
28927         pxr = px * DAS2R;
28928         w = VF * rv * pxr;
28929         pdz = pd * z;
28930         pm[0] = - pr*y - pdz*cr + w*x;
28931         pm[1] =   pr*x - pdz*sr + w*y;
28932         pm[2] =   pd*cd + w*z;
28933 
28934         /* Coordinate direction of star (unit vector, BCRS). */
28935         for (i = 0; i < 3; i++) {
28936             p[i] += dt*pm[i] - pxr*pob[i];
28937         }
28938         NormalizedVector pco = jauPn(p);
28939 
28940         return pco.u;
28941         /* Finished. */
28942 
28943 
28944     }
28945 
28946     /**
28947      *  Star proper motion:  update star catalog data for space motion, with
28948      *  special handling to handle the zero parallax case.
28949      *
28950      *<p>This function is derived from the International Astronomical Union's
28951      *  SOFA (Standards of Fundamental Astronomy) software collection.
28952      *
28953      *<p>Status:  support function.
28954      *
28955      *<!-- Given: -->
28956      *     @param ra1     double       right ascension (radians), before
28957      *     @param dec1    double       declination (radians), before
28958      *     @param pmr1    double       RA proper motion (radians/year), before
28959      *     @param pmd1    double       Dec proper motion (radians/year), before
28960      *     @param px1     double       parallax (arcseconds), before
28961      *     @param rv1     double       radial velocity (km/s, +ve = receding), before
28962      *     @param ep1a    double       "before" epoch, part A (Note 1)
28963      *     @param ep1b    double       "before" epoch, part B (Note 1)
28964      *     @param ep2a    double       "after" epoch, part A (Note 1)
28965      *     @param ep2b    double       "after" epoch, part B (Note 1)
28966      *
28967      *<!-- Returned:-->
28968      *     @return ra2     double        <b>Returned</b> right ascension (radians), after
28969      *             dec2    double        <b>Returned</b> declination (radians), after
28970      *             pmr2    double        <b>Returned</b> RA proper motion (radians/year), after
28971      *             pmd2    double        <b>Returned</b> Dec proper motion (radians/year), after
28972      *             px2     double        <b>Returned</b> parallax (arcseconds), after
28973      *             rv2     double        <b>Returned</b> radial velocity (km/s, +ve = receding), after
28974      *
28975      *  
28976      *  @throws JSOFAInternalError          int         status:
28977      *                         -1  =   <b>Returned</b> system error (should not occur)
28978      *                          0  =   <b>Returned</b> no warnings or errors
28979      *                          1  =   <b>Returned</b> distance overridden (Note 6)
28980      *                          2  =   <b>Returned</b> excessive velocity (Note 7)
28981      *                          4  =   <b>Returned</b> solution didn't converge (Note 8)
28982      *                        else  =   <b>Returned</b> binary logical OR of the above warnings
28983      *
28984      *<p>Notes:
28985      * <ol>
28986      *
28987      *  <li> The starting and ending TDB epochs ep1a+ep1b and ep2a+ep2b are
28988      *     Julian Dates, apportioned in any convenient way between the two
28989      *     parts (A and B).  For example, JD(TDB)=2450123.7 could be
28990      *     expressed in any of these ways, among others:
28991      *
28992      *            <p>epNa            epNb
28993      *
28994      *         2450123.7           0.0       (JD method)
28995      *         2451545.0       -1421.3       (J2000 method)
28996      *         2400000.5       50123.2       (MJD method)
28997      *         2450123.5           0.2       (date &amp; time method)
28998      *
28999      *     <p>The JD method is the most natural and convenient to use in cases
29000      *     where the loss of several decimal digits of resolution is
29001      *     acceptable.  The J2000 method is best matched to the way the
29002      *     argument is handled internally and will deliver the optimum
29003      *     resolution.  The MJD method and the date &amp; time methods are both
29004      *     good compromises between resolution and convenience.
29005      *
29006      *  <li> In accordance with normal star-catalog conventions, the object's
29007      *     right ascension and declination are freed from the effects of
29008      *     secular aberration.  The frame, which is aligned to the catalog
29009      *     equator and equinox, is Lorentzian and centered on the SSB.
29010      *
29011      *     <p>The proper motions are the rate of change of the right ascension
29012      *     and declination at the catalog epoch and are in radians per TDB
29013      *     Julian year.
29014      *
29015      *     <p>The parallax and radial velocity are in the same frame.
29016      *
29017      *  <li> Care is needed with units.  The star coordinates are in radians
29018      *     and the proper motions in radians per Julian year, but the
29019      *     parallax is in arcseconds.
29020      *
29021      *  <li> The RA proper motion is in terms of coordinate angle, not true
29022      *     angle.  If the catalog uses arcseconds for both RA and Dec proper
29023      *     motions, the RA proper motion will need to be divided by cos(Dec)
29024      *     before use.
29025      *
29026      *  <li> Straight-line motion at constant speed, in the inertial frame, is
29027      *     assumed.
29028      *
29029      *  <li> An extremely small (or zero or negative) parallax is overridden
29030      *     to ensure that the object is at a finite but very large distance,
29031      *     but not so large that the proper motion is equivalent to a large
29032      *     but safe speed (about 0.1c using the chosen constant).  A warning
29033      *     status of 1 is added to the status if this action has been taken.
29034      *
29035      *  <li> If the space velocity is a significant fraction of c (see the
29036      *     constant VMAX in the function iauStarpv), it is arbitrarily set
29037      *     to zero.  When this action occurs, 2 is added to the status.
29038      *
29039      *  <li> The relativistic adjustment carried out in the iauStarpv function
29040      *     involves an iterative calculation.  If the process fails to
29041      *     converge within a set number of iterations, 4 is added to the
29042      *     status.
29043      *
29044      * </ol>
29045      *  Called:
29046      * <ul>
29047      *     <li>{@link #jauSeps} angle between two points
29048      *     <li>{@link #jauStarpm} update star catalog data for space motion
29049      *
29050      * </ul>
29051      *@version  2013 October 9
29052      *
29053      *@since JSOFA release 20131202
29054      *
29055      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
29056      * @throws JSOFAInternalError an internal error has occured
29057      */
29058     public static CatalogCoords jauPmsafe(double ra1, double dec1, double pmr1, double pmd1,
29059             double px1, double rv1,
29060             double ep1a, double ep1b, double ep2a, double ep2b) throws JSOFAInternalError
29061     {
29062 
29063         /* Minimum allowed parallax (arcsec) */
29064         final double PXMIN = 5e-7;
29065 
29066         /* Factor giving maximum allowed transverse speed of about 1% c */
29067         final double F = 326.0;
29068 
29069         double pm, px1a;
29070 
29071 
29072         /* Proper motion in one year (radians). */
29073         pm = jauSeps(ra1, dec1, ra1+pmr1, dec1+pmd1);
29074 
29075         
29076         px1a = px1;
29077         pm *= F;
29078         if (px1a < pm) {px1a = pm;}
29079         if (px1a < PXMIN) {px1a = PXMIN;}
29080 
29081         /* Carry out the transformation using the modified parallax. */
29082         return jauStarpm(ra1, dec1, pmr1, pmd1, px1a, rv1,
29083                 ep1a, ep1b, ep2a, ep2b);
29084 
29085          /* Finished. */
29086 
29087 
29088     }
29089 
29090     /**
29091      *  Position and velocity of a terrestrial observing station.
29092      *
29093      *<p>This function is derived from the International Astronomical Union's
29094      *  SOFA (Standards of Fundamental Astronomy) software collection.
29095      *
29096      *<p>Status:  support function.
29097      *
29098      *<!-- Given: -->
29099      *     @param elong    double        longitude (radians, east +ve, Note 1)
29100      *     @param phi      double        latitude (geodetic, radians, Note 1)
29101      *     @param hm       double        height above ref. ellipsoid (geodetic, m)
29102      *     @param xp double        coordinates of the pole (radians, Note 2)
29103      *     @param yp double        coordinates of the pole (radians, Note 2) 
29104      *     @param sp       double        the TIO locator s' (radians, Note 2)
29105      *     @param theta    double        Earth rotation angle (radians, Note 3)
29106      *
29107      *<!-- Returned:-->
29108      *     @return pv       double[2][3]   <b>Returned</b> position/velocity vector (m, m/s, CIRS)
29109      *
29110      *<p>Notes:
29111      * <ol>
29112      *
29113      *  <li> The terrestrial coordinates are with respect to the WGS84
29114      *     reference ellipsoid.
29115      *
29116      *  <li> xp and yp are the coordinates (in radians) of the Celestial
29117      *     Intermediate Pole with respect to the International Terrestrial
29118      *     Reference System (see IERS Conventions), measured along the
29119      *     meridians 0 and 90 deg west respectively.  sp is the TIO locator
29120      *     s', in radians, which positions the Terrestrial Intermediate
29121      *     Origin on the equator.  For many applications, xp, yp and
29122      *     (especially) sp can be set to zero.
29123      *
29124      *  <li> If theta is Greenwich apparent sidereal time instead of Earth
29125      *     rotation angle, the result is with respect to the true equator
29126      *     and equinox of date, i.e. with the x-axis at the equinox rather
29127      *     than the celestial intermediate origin.
29128      *
29129      *  <li> The velocity units are meters per UT1 second, not per SI second.
29130      *     This is unlikely to have any practical consequences in the modern
29131      *     era.
29132      *
29133      *  <li> No validation is performed on the arguments.  Error cases that
29134      *     could lead to arithmetic exceptions are trapped by the iauGd2gc
29135      *     function, and the result set to zeros.
29136      *
29137      * </ol>
29138      *<p>References:
29139      * <ul>
29140      *
29141      * <li> McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
29142      *     IERS Technical Note No. 32, BKG (2004)
29143      *
29144      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
29145      *     the Astronomical Almanac, 3rd ed., University Science Books
29146      *     (2013), Section 7.4.3.3.
29147      *
29148      * </ul>
29149      *  Called:
29150      * <ul>
29151      *     <li>{@link #jauGd2gc} geodetic to geocentric transformation
29152      *     <li>{@link #jauPom00} polar motion matrix
29153      *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
29154      *
29155      * </ul>
29156      *@version  2013 October 9
29157      *
29158      * @since JSOFA release 20131202
29159      *
29160      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
29161      * @throws JSOFAInternalError an internal error has occured
29162      * @throws JSOFAIllegalParameter unacceptable date.
29163      */
29164     public static double [][] jauPvtob(double elong, double phi, double hm,
29165             double xp, double yp, double sp, double theta
29166             ) throws JSOFAIllegalParameter, JSOFAInternalError
29167     {
29168 
29169         double xyzm[];
29170 
29171         /* Geodetic to geocentric transformation (WGS84). */
29172         xyzm = jauGd2gc(1, elong, phi, hm);
29173 
29174         return jauPvtob(xyzm, xp, yp, sp, theta );
29175         /* Finished. */
29176 
29177 
29178     }
29179     
29180     /**
29181      * Alternative Position and velocity of a terrestrial observing station with observatory position already in cartesian.
29182      * @see JSOFA#jauPvtob(double, double, double, double, double, double, double) for more detail.
29183      * @param xyzm observatory geocentric position in metres.
29184      * @param xp double        coordinates of the pole (radians, Note 2)
29185      * @param yp double        coordinates of the pole (radians, Note 2) 
29186      * @param sp       double        the TIO locator s' (radians, Note 2)
29187      * @param theta    double        Earth rotation angle (radians, Note 3)
29188      * @return pv       double[2][3]   <b>Returned</b> position/velocity vector (m, m/s, CIRS)
29189      * @throws JSOFAIllegalParameter unacceptable date.
29190      * @throws JSOFAInternalError an internal error has occured
29191      */
29192     public static double [][] jauPvtob(double xyzm[],
29193             double xp, double yp, double sp, double theta
29194             ) throws JSOFAIllegalParameter, JSOFAInternalError
29195     {
29196         /* Earth rotation rate in radians per UT1 second */
29197         final double OM = 1.00273781191135448 * D2PI / DAYSEC;
29198 
29199         double rpm[][], xyz[], x, y, z, s, c;
29200         double pv[][] = new double[2][3];
29201 
29202       
29203         /* Polar motion and TIO position. */
29204         rpm = jauPom00(xp, yp, sp);
29205         xyz = jauTrxp(rpm, xyzm);
29206         x = xyz[0];
29207         y = xyz[1];
29208         z = xyz[2];
29209 
29210         /* Functions of ERA. */
29211         s = sin(theta);
29212         c = cos(theta);
29213 
29214         /* Position. */
29215         pv[0][0] = c*x - s*y;
29216         pv[0][1] = s*x + c*y;
29217         pv[0][2] = z;
29218 
29219         /* Velocity. */
29220         pv[1][0] = OM * ( -s*x - c*y );
29221         pv[1][1] = OM * (  c*x - s*y );
29222         pv[1][2] = 0.0;
29223 
29224         return pv;
29225         /* Finished. */
29226 
29227 
29228     }
29229 
29230     /**
29231      * constants A and B in the atmospheric refraction model
29232      *  dZ = A tan Z + B tan^3 Z.
29233      *  .
29234      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Mar 2014
29235      * @version $Revision$ $date$
29236      */
29237     public static class RefCos {
29238         /**    refraction coefficient A  */
29239         public double    a ;
29240 
29241         /**    refraction coefficient B  */
29242         public double    b ;
29243         public RefCos(double a, double b) {
29244           this.a = a;
29245           this.b = b;
29246        }
29247        
29248    }
29249 
29250     /**
29251      *  Determine the constants A and B in the atmospheric refraction model
29252      *  dZ = A tan Z + B tan^3 Z.
29253      *
29254      *  Z is the "observed" zenith distance (i.e. affected by refraction)
29255      *  and dZ is what to add to Z to give the "topocentric" (i.e. in vacuo)
29256      *  zenith distance.
29257      *
29258      *<p>This function is derived from the International Astronomical Union's
29259      *  SOFA (Standards of Fundamental Astronomy) software collection.
29260      *
29261      *<p>Status:  support function.
29262      *
29263      *<!-- Given: -->
29264      *    @param phpa    double     pressure at the observer (hPa = millibar)
29265      *    @param tc      double     ambient temperature at the observer (deg C)
29266      *    @param rh      double     relative humidity at the observer (range 0-1)
29267      *    @param wl      double     wavelength (micrometers)
29268      *
29269      *<!-- Returned:-->
29270      *    @return      <b>Returned</b> tan Z coefficient (radians)
29271      *                 <b>Returned</b> tan^3 Z coefficient (radians)
29272      *
29273      *<p>Notes:
29274      * <ol>
29275      *
29276      *  <li> The model balances speed and accuracy to give good results in
29277      *     applications where performance at low altitudes is not paramount.
29278      *     Performance is maintained across a range of conditions, and
29279      *     applies to both optical/IR and radio.
29280      *
29281      *  <li> The model omits the effects of (i) height above sea level (apart
29282      *     from the reduced pressure itself), (ii) latitude (i.e. the
29283      *     flattening of the Earth), (iii) variations in tropospheric lapse
29284      *     rate and (iv) dispersive effects in the radio.
29285      *
29286      *     <p>The model was tested using the following range of conditions:
29287      *
29288      *       <p>lapse rates 0.0055, 0.0065, 0.0075 deg/meter
29289      *       latitudes 0, 25, 50, 75 degrees
29290      *       heights 0, 2500, 5000 meters ASL
29291      *       pressures mean for height -10% to +5% in steps of 5%
29292      *       temperatures -10 deg to +20 deg with respect to 280 deg at SL
29293      *       relative humidity 0, 0.5, 1
29294      *       wavelengths 0.4, 0.6, ... 2 micron, + radio
29295      *       zenith distances 15, 45, 75 degrees
29296      *
29297      *     <p>The accuracy with respect to raytracing through a model
29298      *     atmosphere was as follows:
29299      *
29300      *                            <p>worst         RMS
29301      *
29302      *       <p>optical/IR           62 mas       8 mas
29303      *       radio               319 mas      49 mas
29304      *
29305      *     <p>For this particular set of conditions:
29306      *
29307      *       <p>lapse rate 0.0065 K/meter
29308      *       latitude 50 degrees
29309      *       sea level
29310      *       pressure 1005 mb
29311      *       temperature 280.15 K
29312      *       humidity 80%
29313      *       wavelength 5740 Angstroms
29314      *
29315      *     <p>the results were as follows:
29316      *
29317      *       <p>ZD       raytrace     iauRefco   Saastamoinen
29318      *
29319      *       10         10.27        10.27        10.27
29320      *       20         21.19        21.20        21.19
29321      *       30         33.61        33.61        33.60
29322      *       40         48.82        48.83        48.81
29323      *       45         58.16        58.18        58.16
29324      *       50         69.28        69.30        69.27
29325      *       55         82.97        82.99        82.95
29326      *       60        100.51       100.54       100.50
29327      *       65        124.23       124.26       124.20
29328      *       70        158.63       158.68       158.61
29329      *       72        177.32       177.37       177.31
29330      *       74        200.35       200.38       200.32
29331      *       76        229.45       229.43       229.42
29332      *       78        267.44       267.29       267.41
29333      *       80        319.13       318.55       319.10
29334      *
29335      *      <p>deg        arcsec       arcsec       arcsec
29336      *
29337      *     <p>The values for Saastamoinen's formula (which includes terms
29338      *     up to tan^5) are taken from Hohenkerk and Sinclair (1985).
29339      *
29340      *  <li> A wl value in the range 0-100 selects the optical/IR case and is
29341      *     wavelength in micrometers.  Any value outside this range selects
29342      *     the radio case.
29343      *
29344      *  <li> Outlandish input parameters are silently limited to
29345      *     mathematically safe values.  Zero pressure is permissible, and
29346      *     causes zeroes to be returned.
29347      *
29348      *  <li> The algorithm draws on several sources, as follows:
29349      *
29350      *     <p>a) The formula for the saturation vapour pressure of water as
29351      *        a function of temperature and temperature is taken from
29352      *        Equations (A4.5-A4.7) of Gill (1982).
29353      *
29354      *     <p>b) The formula for the water vapour pressure, given the
29355      *        saturation pressure and the relative humidity, is from
29356      *        Crane (1976), Equation (2.5.5).
29357      *
29358      *     <p>c) The refractivity of air is a function of temperature,
29359      *        total pressure, water-vapour pressure and, in the case
29360      *        of optical/IR, wavelength.  The formulae for the two cases are
29361      *        developed from Hohenkerk &amp; Sinclair (1985) and Rueger (2002).
29362      *        The IAG (1999) optical refractivity for dry air is used.
29363      *
29364      *     <p>d) The formula for beta, the ratio of the scale height of the
29365      *        atmosphere to the geocentric distance of the observer, is
29366      *        an adaption of Equation (9) from Stone (1996).  The
29367      *        adaptations, arrived at empirically, consist of (i) a small
29368      *        adjustment to the coefficient and (ii) a humidity term for the
29369      *        radio case only.
29370      *
29371      *     <p>e) The formulae for the refraction constants as a function of
29372      *        n-1 and beta are from Green (1987), Equation (4.31).
29373      *
29374      * </ol>
29375      *<p>References:
29376      * <ul>
29377      *
29378      * <li> Crane, R.K., Meeks, M.L. (ed), "Refraction Effects in the Neutral
29379      *     Atmosphere", Methods of Experimental Physics: Astrophysics 12B,
29380      *     Academic Press, 1976.
29381      *
29382      * <li> Gill, Adrian E., "Atmosphere-Ocean Dynamics", Academic Press,
29383      *     1982.
29384      *
29385      * <li> Green, R.M., "Spherical Astronomy", Cambridge University Press,
29386      *     1987.
29387      *
29388      * <li> Hohenkerk, C.Y., &amp; Sinclair, A.T., NAO Technical Note No. 63,
29389      *     1985.
29390      *     
29391      * <li> IAG Resolutions adopted at the XXIIth General Assembly in
29392      *     Birmingham, 1999, Resolution 3.
29393      *
29394      * <li> Rueger, J.M., "Refractive Index Formulae for Electronic Distance
29395      *     Measurement with Radio and Millimetre Waves", in Unisurv Report
29396      *     S-68, School of Surveying and Spatial Information Systems,
29397      *     University of New South Wales, Sydney, Australia, 2002.
29398      *
29399      * <li> Stone, Ronald C., P.A.S.P. 108, 1051-1058, 1996.
29400      *
29401      * </ul>
29402      *@version  2013 October 9
29403      *
29404      *@since JSOFA release 20131202
29405      *
29406      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
29407      */
29408     public static RefCos jauRefco(double phpa, double tc, double rh, double wl )
29409     {
29410         boolean optic;
29411         double p, t, r, w, ps, pw, tk, wlsq, gamma, beta;
29412 
29413 
29414         /* Decide whether optical/IR or radio case:  switch at 100 microns. */
29415         optic = ( wl <= 100.0 );
29416 
29417         /* Restrict parameters to safe values. */
29418         t = max ( tc, -150.0 );
29419         t = min ( t, 200.0 );
29420         p = max ( phpa, 0.0 );
29421         p = min ( p, 10000.0 );
29422         r = max ( rh, 0.0 );
29423         r = min ( r, 1.0 );
29424         w = max ( wl, 0.1 );
29425         w = min ( w, 1e6 );
29426 
29427         /* Water vapour pressure at the observer. */
29428         if ( p > 0.0 ) {
29429             ps = pow ( 10.0, ( 0.7859 + 0.03477*t ) /
29430                     ( 1.0 + 0.00412*t ) ) *
29431                     ( 1.0 + p * ( 4.5e-6 + 6e-10*t*t )  );
29432             pw = r * ps / ( 1.0 - (1.0-r)*ps/p );
29433         } else {
29434             pw = 0.0;
29435         }
29436 
29437         /* Refractive index minus 1 at the observer. */
29438         tk = t + 273.15;
29439         if ( optic ) {
29440             wlsq = w * w;
29441             gamma = ( ( 77.53484e-6 +
29442                     ( 4.39108e-7 + 3.666e-9/wlsq ) / wlsq ) * p
29443                     - 11.2684e-6*pw ) / tk;
29444         } else {
29445             gamma = ( 77.6890e-6*p - ( 6.3938e-6 - 0.375463/tk ) * pw ) / tk;
29446         }
29447 
29448         /* Formula for beta from Stone, with empirical adjustments. */
29449         beta = 4.4474e-6 * tk;
29450         if ( ! optic ) beta -= 0.0074 * pw * beta;
29451 
29452         /* Refraction constants from Green. */
29453         return new RefCos( gamma * ( 1.0 - beta ),
29454                - gamma * ( beta - gamma / 2.0 ));
29455 
29456         /* Finished. */
29457 
29458 
29459     }
29460  
29461     
29462     /**
29463     *  Transformation from Galactic Coordinates to ICRS.
29464     *
29465     *  This function is derived from the International Astronomical Union's
29466     *  SOFA (Standards of Fundamental Astronomy) software collection.
29467     *
29468     *  <p>Status:  support routine.
29469     *
29470     *  @param   dl     double      galactic longitude (radians)
29471     *  @param   db     double      galactic latitude (radians)
29472     *
29473     *  @return co ICRS right ascension, declination.
29474     *
29475     *  <p>Notes:<ol>
29476     *
29477     *  <li> The IAU 1958 system of Galactic coordinates was defined with
29478     *     respect to the now obsolete reference system FK4 B1950.0.  When
29479     *     interpreting the system in a modern context, several factors have
29480     *     to be taken into account:<ul>
29481     *
29482     *     <li> The inclusion in FK4 positions of the E-terms of aberration.
29483     *
29484     *     <li> The distortion of the FK4 proper motion system by differential
29485     *       Galactic rotation.
29486     *
29487     *     <li> The use of the B1950.0 equinox rather than the now-standard
29488     *       J2000.0.
29489     *
29490     *     <li> The frame bias between ICRS and the J2000.0 mean place system.
29491     *  </ul>
29492     *     The Hipparcos Catalogue (Perryman &amp; ESA 1997) provides a rotation
29493     *     matrix that transforms directly between ICRS and Galactic
29494     *     coordinates with the above factors taken into account.  The
29495     *     matrix is derived from three angles, namely the ICRS coordinates
29496     *     of the Galactic pole and the longitude of the ascending node of
29497     *     the galactic equator on the ICRS equator.  They are given in
29498     *     degrees to five decimal places and for canonical purposes are
29499     *     regarded as exact.  In the Hipparcos Catalogue the matrix
29500     *     elements are given to 10 decimal places (about 20 microarcsec).
29501     *     In the present SOFA function the matrix elements have been
29502     *     recomputed from the canonical three angles and are given to 30
29503     *     decimal places.
29504     *
29505     *  <li> The inverse transformation is performed by the function jauIcrs2g.
29506     *  </ol>
29507     *
29508     *  Reference:
29509     *     Perryman M.A.C. &amp; ESA, 1997, ESA SP-1200, The Hipparcos and Tycho
29510     *     catalogues.  Astrometric and photometric star catalogues
29511     *     derived from the ESA Hipparcos Space Astrometry Mission.  ESA
29512     *     Publications Division, Noordwijk, Netherlands.
29513     *
29514     *  @version  2015 March 02
29515     * 
29516     *
29517     *  @since JSOFA release 20150209
29518     *
29519     */
29520     public static SphericalCoordinate jauG2icrs ( double dl, double db)
29521     {
29522        double v1[], v2[];
29523 
29524     /*
29525     *  L2,B2 system of galactic coordinates in the form presented in the
29526     *  Hipparcos Catalogue.  In degrees:
29527     *
29528     *  P = 192.85948    right ascension of the Galactic north pole in ICRS
29529     *  Q =  27.12825    declination of the Galactic north pole in ICRS
29530     *  R =  32.93192    Galactic longitude of the ascending node of
29531     *                   the Galactic equator on the ICRS equator
29532     *
29533     *  ICRS to galactic rotation matrix, obtained by computing
29534     *  R_3(-R) R_1(pi/2-Q) R_3(pi/2+P) to the full precision shown:
29535     */
29536        double r[][]  = new double[][]{ { -0.054875560416215368492398900454,
29537                             -0.873437090234885048760383168409,
29538                             -0.483835015548713226831774175116 },
29539                           { +0.494109427875583673525222371358,
29540                             -0.444829629960011178146614061616,
29541                             +0.746982244497218890527388004556 },
29542                           { -0.867666149019004701181616534570,
29543                             -0.198076373431201528180486091412,
29544                             +0.455983776175066922272100478348 } };
29545 
29546 
29547     /* Spherical to Cartesian. */
29548        v1 = jauS2c(dl, db);
29549 
29550     /* Galactic to ICRS. */
29551        v2 = jauTrxp(r, v1);
29552 
29553     /* Cartesian to spherical. */
29554        SphericalCoordinate co = jauC2s(v2);
29555 
29556     /* Express in conventional ranges. */
29557        co.alpha = jauAnp(co.alpha);
29558        co.delta = jauAnpm(co.delta);
29559 
29560     /* Finished. */
29561       return co;
29562     }
29563  
29564     
29565     
29566     /**
29567     *  Transformation from ICRS to Galactic Coordinates.
29568     *
29569     *  This function is derived from the International Astronomical Union's
29570     *  SOFA (Standards of Fundamental Astronomy) software collection.
29571     *
29572     *  <p>Status:  support routine.
29573     *
29574     *     @param dr     double      ICRS right ascension (radians)
29575     *     @param dd     double      ICRS declination (radians)
29576     *
29577     *  @return co galactic longitude (radians), galactic latitude (radians)
29578     *
29579     *  <p>Notes:<ol>
29580     *
29581     *  <li> The IAU 1958 system of Galactic coordinates was defined with
29582     *     respect to the now obsolete reference system FK4 B1950.0.  When
29583     *     interpreting the system in a modern context, several factors have
29584     *     to be taken into account:<ul>
29585     *
29586     *     <li> The inclusion in FK4 positions of the E-terms of aberration.
29587     *
29588     *     <li> The distortion of the FK4 proper motion system by differential
29589     *       Galactic rotation.
29590     *
29591     *     <li> The use of the B1950.0 equinox rather than the now-standard
29592     *       J2000.0.
29593     *
29594     *     <li> The frame bias between ICRS and the J2000.0 mean place system.
29595     *     </ul>
29596     *     The Hipparcos Catalogue (Perryman &amp; ESA 1997) provides a rotation
29597     *     matrix that transforms directly between ICRS and Galactic
29598     *     coordinates with the above factors taken into account.  The
29599     *     matrix is derived from three angles, namely the ICRS coordinates
29600     *     of the Galactic pole and the longitude of the ascending node of
29601     *     the galactic equator on the ICRS equator.  They are given in
29602     *     degrees to five decimal places and for canonical purposes are
29603     *     regarded as exact.  In the Hipparcos Catalogue the matrix
29604     *     elements are given to 10 decimal places (about 20 microarcsec).
29605     *     In the present SOFA function the matrix elements have been
29606     *     recomputed from the canonical three angles and are given to 30
29607     *     decimal places.
29608     *
29609     *  <li> The inverse transformation is performed by the function iauG2icrs.
29610     *  </ol>
29611     *  Reference:
29612     *     Perryman M.A.C. &amp; ESA, 1997, ESA SP-1200, The Hipparcos and Tycho
29613     *     catalogues.  Astrometric and photometric star catalogues
29614     *     derived from the ESA Hipparcos Space Astrometry Mission.  ESA
29615     *     Publications Division, Noordwijk, Netherlands.
29616     *
29617     *  @version   2015 January 20
29618     *
29619     *  @since JSOFA release 20150209
29620     *
29621     */
29622     public static SphericalCoordinate jauIcrs2g ( double dr, double dd )
29623     {
29624        double v1[], v2[];
29625 
29626     /*
29627     *  L2,B2 system of galactic coordinates in the form presented in the
29628     *  Hipparcos Catalogue.  In degrees:
29629     *
29630     *  P = 192.85948    right ascension of the Galactic north pole in ICRS
29631     *  Q =  27.12825    declination of the Galactic north pole in ICRS
29632     *  R =  32.93192    longitude of the ascending node of the Galactic
29633     *                   plane on the ICRS equator
29634     *
29635     *  ICRS to galactic rotation matrix, obtained by computing
29636     *  R_3(-R) R_1(pi/2-Q) R_3(pi/2+P) to the full precision shown:
29637     */
29638        double r[][] = new double[][] { { -0.054875560416215368492398900454,
29639                             -0.873437090234885048760383168409,
29640                             -0.483835015548713226831774175116 },
29641                           { +0.494109427875583673525222371358,
29642                             -0.444829629960011178146614061616,
29643                             +0.746982244497218890527388004556 },
29644                           { -0.867666149019004701181616534570,
29645                             -0.198076373431201528180486091412,
29646                             +0.455983776175066922272100478348 } };
29647 
29648 
29649     /* Spherical to Cartesian. */
29650        v1 = jauS2c(dr, dd);
29651 
29652     /* ICRS to Galactic. */
29653        v2 = jauRxp(r, v1);
29654 
29655     /* Cartesian to spherical. */
29656        SphericalCoordinate co = jauC2s(v2);
29657 
29658     /* Express in conventional ranges. */
29659        co.alpha = jauAnp(co.alpha);
29660        co.delta = jauAnpm(co.delta);
29661        return co;
29662     }
29663 
29664 // 2016-05-03 additions below    
29665     
29666     /**
29667     *
29668     *  Transformation from ecliptic coordinates (mean equinox and ecliptic
29669     *  of date) to ICRS RA,Dec, using the IAU 2006 precession model.
29670     *
29671     * <p>This function is derived from the International Astronomical Union's
29672     *  SOFA (Standards of Fundamental Astronomy) software collection.
29673     *
29674     *  <p>Status:  support function.
29675     *
29676     *  <!-- Given: -->
29677     *     @param date1 double TT as a 2-part Julian date (Note 1)
29678     *     @param date2 double TT as a 2-part Julian date (Note 1) 
29679     *     @param dl double ecliptic longitude and latitude (radians)
29680     *     @param db double ecliptic longitude and latitude (radians) 
29681     *
29682     * <!-- Returned: -->
29683     *     @return      double ICRS right ascension and declination (radians)
29684     *
29685     *<ol>
29686     *  <li> The TT date date1+date2 is a Julian Date, apportioned in any
29687     *     convenient way between the two arguments.  For example,
29688     *     JD(TT)=2450123.7 could be expressed in any of these ways,
29689     *     among others:
29690     *
29691     *            date1          date2
29692     *
29693     *         2450123.7           0.0       (JD method)
29694     *         2451545.0       -1421.3       (J2000 method)
29695     *         2400000.5       50123.2       (MJD method)
29696     *         2450123.5           0.2       (date &amp; time method)
29697     *
29698     *     The JD method is the most natural and convenient to use in
29699     *     cases where the loss of several decimal digits of resolution
29700     *     is acceptable.  The J2000 method is best matched to the way
29701     *     the argument is handled internally and will deliver the
29702     *     optimum resolution.  The MJD method and the date &amp; time methods
29703     *     are both good compromises between resolution and convenience.
29704     *
29705     *  <li> No assumptions are made about whether the coordinates represent
29706     *     starlight and embody astrometric effects such as parallax or
29707     *     aberration.
29708     *
29709     *  <li> The transformation is approximately that from ecliptic longitude
29710     *     and latitude (mean equinox and ecliptic of date) to mean J2000.0
29711     *     right ascension and declination, with only frame bias (always
29712     *     less than 25 mas) to disturb this classical picture.
29713     *</ol>
29714     *  Called: <ul>
29715     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
29716     *     <li>{@link #jauEcm06}     J2000.0 to ecliptic rotation matrix, IAU 2006
29717     *     <li>{@link #jauTrxp}      product of transpose of r-matrix and p-vector
29718     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
29719     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
29720     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
29721     *</ul>
29722     *
29723     *   @version  2016 February 9
29724     *
29725     *  @since JSOFA release 20160503
29726     *
29727     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29728     */
29729     public static SphericalCoordinate jauEceq06(double date1, double date2, double dl, double db)
29730     {
29731 
29732 
29733     /* Spherical to Cartesian. */
29734        double v1[] = jauS2c(dl, db);
29735 
29736     /* Rotation matrix, ICRS equatorial to ecliptic. */
29737        double rm[][] = jauEcm06(date1, date2);
29738 
29739     /* The transformation from ecliptic to ICRS. */
29740        double v2[] = jauTrxp(rm, v1);
29741 
29742     /* Cartesian to spherical. */
29743        SphericalCoordinate co = jauC2s(v2);
29744 
29745     /* Express in conventional ranges. */
29746        co.alpha = jauAnp(co.alpha);
29747        co.delta = jauAnpm(co.delta);
29748 
29749        return co;
29750     }
29751 
29752     /**
29753     *
29754     *  ICRS equatorial to ecliptic rotation matrix, IAU 2006.
29755     *
29756     * <p>This function is derived from the International Astronomical Union's
29757     *  SOFA (Standards of Fundamental Astronomy) software collection.
29758     *
29759     *  <p>Status:  support function.
29760     *
29761     *  <!-- Given: -->
29762     *    @param date1 double         TT as a 2-part Julian date (Note 1)
29763     *    @param date2 double         TT as a 2-part Julian date (Note 1) 
29764     *
29765     * <!-- Returned: -->
29766     *     @return          double[3][3]   ICRS to ecliptic rotation matrix
29767     *
29768     *  <p>Notes: <ol>
29769     *
29770     *  <li> The TT date date1+date2 is a Julian Date, apportioned in any
29771     *     convenient way between the two arguments.  For example,
29772     *     JD(TT)=2450123.7 could be expressed in any of these ways,
29773     *     among others:
29774     *
29775     *            date1          date2
29776     *
29777     *         2450123.7           0.0       (JD method)
29778     *         2451545.0       -1421.3       (J2000 method)
29779     *         2400000.5       50123.2       (MJD method)
29780     *         2450123.5           0.2       (date &amp; time method)
29781     *
29782     *     The JD method is the most natural and convenient to use in
29783     *     cases where the loss of several decimal digits of resolution
29784     *     is acceptable.  The J2000 method is best matched to the way
29785     *     the argument is handled internally and will deliver the
29786     *     optimum resolution.  The MJD method and the date &amp; time methods
29787     *     are both good compromises between resolution and convenience.
29788     *
29789     *  <li> The matrix is in the sense
29790     *
29791     *        E_ep = rm x P_ICRS,
29792     *
29793     *     where P_ICRS is a vector with respect to ICRS right ascension
29794     *     and declination axes and E_ep is the same vector with respect to
29795     *     the (inertial) ecliptic and equinox of date.
29796     *
29797     *  <li> P_ICRS is a free vector, merely a direction, typically of unit
29798     *     magnitude, and not bound to any particular spatial origin, such
29799     *     as the Earth, Sun or SSB.  No assumptions are made about whether
29800     *     it represents starlight and embodies astrometric effects such as
29801     *     parallax or aberration.  The transformation is approximately that
29802     *     between mean J2000.0 right ascension and declination and ecliptic
29803     *     longitude and latitude, with only frame bias (always less than
29804     *     25 mas) to disturb this classical picture.
29805     *  </ol>
29806     *  Called: <ul>
29807     *     <li>{@link #jauObl06}     mean obliquity, IAU 2006
29808     *     <li>{@link #jauPmat06}    PB matrix, IAU 2006
29809     *     <li>{@link #jauIr}        initialize r-matrix to identity
29810     *     <li>{@link #jauRx}        rotate around X-axis
29811     *     <li>{@link #jauRxr}       product of two r-matrices
29812     *</ul>
29813     *
29814     *   @version  2015 December 11
29815     *
29816     *  @since JSOFA release 20160503
29817     *
29818     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29819     */
29820     public static double[][] jauEcm06(double date1, double date2)
29821     {
29822        double ob, e[][] = new double[3][3];
29823 
29824 
29825     /* Obliquity, IAU 2006. */
29826        ob = jauObl06(date1, date2);
29827 
29828     /* Precession-bias matrix, IAU 2006. */
29829        double bp[][] = jauPmat06(date1, date2);
29830 
29831     /* Equatorial of date to ecliptic matrix. */
29832        jauIr(e);
29833        jauRx(ob, e);
29834 
29835     /* ICRS to ecliptic coordinates rotation matrix, IAU 2006. */
29836        return jauRxr(e, bp);
29837 
29838     }
29839 
29840     /**
29841     *
29842     *  Transformation from ICRS equatorial coordinates to ecliptic
29843     *  coordinates (mean equinox and ecliptic of date) using IAU 2006
29844     *  precession model.
29845     *
29846     * <p>This function is derived from the International Astronomical Union's
29847     *  SOFA (Standards of Fundamental Astronomy) software collection.
29848     *
29849     *  <p>Status:  support function.
29850     *
29851     *  <!-- Given: -->
29852     *     @param date1 double TT as a 2-part Julian date (Note 1)
29853     *     @param date2 double TT as a 2-part Julian date (Note 1) 
29854     *     @param dr double ICRS right ascension and declination (radians)
29855     *     @param dd double ICRS right ascension and declination (radians) 
29856     *
29857     * <!-- Returned: -->
29858     *     @return      double ecliptic longitude and latitude (radians)
29859     *<ol>
29860     *  <li> The TT date date1+date2 is a Julian Date, apportioned in any
29861     *     convenient way between the two arguments.  For example,
29862     *     JD(TT)=2450123.7 could be expressed in any of these ways,
29863     *     among others:
29864     *
29865     *            date1          date2
29866     *
29867     *         2450123.7           0.0       (JD method)
29868     *         2451545.0       -1421.3       (J2000 method)
29869     *         2400000.5       50123.2       (MJD method)
29870     *         2450123.5           0.2       (date &amp; time method)
29871     *
29872     *     The JD method is the most natural and convenient to use in
29873     *     cases where the loss of several decimal digits of resolution
29874     *     is acceptable.  The J2000 method is best matched to the way
29875     *     the argument is handled internally and will deliver the
29876     *     optimum resolution.  The MJD method and the date &amp; time methods
29877     *     are both good compromises between resolution and convenience.
29878     *
29879     *  <li> No assumptions are made about whether the coordinates represent
29880     *     starlight and embody astrometric effects such as parallax or
29881     *     aberration.
29882     *
29883     *  <li> The transformation is approximately that from mean J2000.0 right
29884     *     ascension and declination to ecliptic longitude and latitude
29885     *     (mean equinox and ecliptic of date), with only frame bias (always
29886     *     less than 25 mas) to disturb this classical picture.
29887     *</ol>
29888     *  Called:<ul>
29889     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
29890     *     <li>{@link #jauEcm06}     J2000.0 to ecliptic rotation matrix, IAU 2006
29891     *     <li>{@link #jauRxp}       product of r-matrix and p-vector
29892     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
29893     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
29894     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
29895     *</ul>
29896     *   @version  2016 February 9
29897     *
29898     *  @since JSOFA release 20160503
29899     *
29900     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29901     */
29902     public static SphericalCoordinate jauEqec06(double date1, double date2, double dr, double dd)
29903     {
29904 
29905     /* Spherical to Cartesian. */
29906       double v1[] = jauS2c(dr, dd);
29907 
29908     /* Rotation matrix, ICRS equatorial to ecliptic. */
29909       double rm[][] = jauEcm06(date1, date2);
29910 
29911     /* The transformation from ICRS to ecliptic. */
29912        double v2[] = jauRxp(rm, v1);
29913 
29914     /* Cartesian to spherical. */
29915        SphericalCoordinate co = jauC2s(v2);
29916 
29917     /* Express in conventional ranges. */
29918        co.alpha = jauAnp(co.alpha);
29919        co.delta = jauAnpm(co.delta);
29920        return co;
29921 
29922     }
29923 
29924     /**
29925     *
29926     *  Transformation from ecliptic coordinates (mean equinox and ecliptic
29927     *  of date) to ICRS RA,Dec, using a long-term precession model.
29928     *
29929     * <p>This function is derived from the International Astronomical Union's
29930     *  SOFA (Standards of Fundamental Astronomy) software collection.
29931     *
29932     *  <p>Status:  support function.
29933     *
29934     *  <!-- Given: -->
29935     *    @param  epj     double     Julian epoch (TT)
29936     *    @param dl double     ecliptic longitude and latitude (radians)
29937     *    @param db double     ecliptic longitude and latitude (radians) 
29938     *
29939     * <!-- Returned: -->
29940     *     @return   double     ICRS right ascension and declination (radians)
29941     *<ol>
29942     *  <li> No assumptions are made about whether the coordinates represent
29943     *     starlight and embody astrometric effects such as parallax or
29944     *     aberration.
29945     *
29946     *  <li> The transformation is approximately that from ecliptic longitude
29947     *     and latitude (mean equinox and ecliptic of date) to mean J2000.0
29948     *     right ascension and declination, with only frame bias (always
29949     *     less than 25 mas) to disturb this classical picture.
29950     *
29951     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
29952     *     agrees with the IAU 2006 precession at J2000.0 and stays within
29953     *     100 microarcseconds during the 20th and 21st centuries.  It is
29954     *     accurate to a few arcseconds throughout the historical period,
29955     *     worsening to a few tenths of a degree at the end of the
29956     *     +/- 200,000 year time span.
29957     *</ol>
29958     *  Called:<ul>
29959     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
29960     *     <li>{@link #jauLtecm}     J2000.0 to ecliptic rotation matrix, long term
29961     *     <li>{@link #jauTrxp}      product of transpose of r-matrix and p-vector
29962     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
29963     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
29964     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
29965     *</ul>
29966     *  References: <ul>
29967     *
29968     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
29969     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
29970     *    A22
29971     *
29972     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
29973     *    expressions, valid for long time intervals (Corrigendum),
29974     *    Astron.Astrophys. 541, C1
29975     *</ul>
29976     *   @version  2016 February 9
29977     *
29978     *  @since JSOFA release 20160503
29979     *
29980     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29981     */
29982     public static SphericalCoordinate jauLteceq(double epj, double dl, double db)
29983     {
29984 
29985     /* Spherical to Cartesian. */
29986        double v1[] = jauS2c(dl, db);
29987 
29988     /* Rotation matrix, ICRS equatorial to ecliptic. */
29989        double rm[][] = jauLtecm(epj);
29990 
29991     /* The transformation from ecliptic to ICRS. */
29992        double v2[] = jauTrxp(rm, v1);
29993 
29994     /* Cartesian to spherical. */
29995        SphericalCoordinate co = jauC2s(v2);
29996 
29997     /* Express in conventional ranges. */
29998        co.alpha = jauAnp(co.alpha);
29999        co.delta = jauAnpm(co.delta);
30000        return co;
30001 
30002     }
30003 
30004     /**
30005     *
30006     *  ICRS equatorial to ecliptic rotation matrix, long-term.
30007     *
30008     * <p>This function is derived from the International Astronomical Union's
30009     *  SOFA (Standards of Fundamental Astronomy) software collection.
30010     *
30011     *  <p>Status:  support function.
30012     *
30013     *  <!-- Given: -->
30014     *     @param epj     double         Julian epoch (TT)
30015     *
30016     * <!-- Returned: -->
30017     *     @return      double[3][3]   ICRS to ecliptic rotation matrix
30018     *
30019     *  <p>Notes: <ol>
30020     *
30021     *  <li> The matrix is in the sense
30022     *
30023     *        E_ep = rm x P_ICRS,
30024     *
30025     *     where P_ICRS is a vector with respect to ICRS right ascension
30026     *     and declination axes and E_ep is the same vector with respect to
30027     *     the (inertial) ecliptic and equinox of epoch epj.
30028     *
30029     *  <li> P_ICRS is a free vector, merely a direction, typically of unit
30030     *     magnitude, and not bound to any particular spatial origin, such
30031     *     as the Earth, Sun or SSB.  No assumptions are made about whether
30032     *     it represents starlight and embodies astrometric effects such as
30033     *     parallax or aberration.  The transformation is approximately that
30034     *     between mean J2000.0 right ascension and declination and ecliptic
30035     *     longitude and latitude, with only frame bias (always less than
30036     *     25 mas) to disturb this classical picture.
30037     *
30038     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30039     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30040     *     100 microarcseconds during the 20th and 21st centuries.  It is
30041     *     accurate to a few arcseconds throughout the historical period,
30042     *     worsening to a few tenths of a degree at the end of the
30043     *     +/- 200,000 year time span.
30044     *</ol>
30045     *  Called:<ul>
30046     *     <li>{@link #jauLtpequ}    equator pole, long term
30047     *     <li>{@link #jauLtpecl}    ecliptic pole, long term
30048     *     <li>{@link #jauPxp}       vector product
30049     *     <li>{@link #jauPn}        normalize vector
30050     *</ul>
30051     *  References:<ul>
30052     *
30053     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30054     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30055     *    A22
30056     *
30057     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30058     *    expressions, valid for long time intervals (Corrigendum),
30059     *    Astron.Astrophys. 541, C1
30060     *</ul>
30061     *   @version  2015 December 6
30062     *
30063     *  @since JSOFA release 20160503
30064     *
30065     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30066     */
30067     public static double[][] jauLtecm(double epj)
30068     {
30069        double rm[][] = new double[3][3];
30070     /* Frame bias (IERS Conventions 2010, Eqs. 5.21 and 5.33) */
30071        final double dx = -0.016617 * DAS2R,
30072                     de = -0.0068192 * DAS2R,
30073                     dr = -0.0146 * DAS2R;
30074 
30075 
30076     /* Equator pole. */
30077        double p[] = jauLtpequ(epj);
30078 
30079     /* Ecliptic pole (bottom row of equatorial to ecliptic matrix). */
30080        double z[] = jauLtpecl(epj);
30081 
30082     /* Equinox (top row of matrix). */
30083        double w[] = jauPxp(p, z);
30084        NormalizedVector nv = jauPn(w);
30085 
30086        double x[] = nv.u;
30087     /* Middle row of matrix. */
30088        double y[] = jauPxp(z, x);
30089 
30090     /* Combine with frame bias. */
30091        rm[0][0] =   x[0]    - x[1]*dr + x[2]*dx;
30092        rm[0][1] =   x[0]*dr + x[1]    + x[2]*de;
30093        rm[0][2] = - x[0]*dx - x[1]*de + x[2];
30094        rm[1][0] =   y[0]    - y[1]*dr + y[2]*dx;
30095        rm[1][1] =   y[0]*dr + y[1]    + y[2]*de;
30096        rm[1][2] = - y[0]*dx - y[1]*de + y[2];
30097        rm[2][0] =   z[0]    - z[1]*dr + z[2]*dx;
30098        rm[2][1] =   z[0]*dr + z[1]    + z[2]*de;
30099        rm[2][2] = - z[0]*dx - z[1]*de + z[2];
30100 
30101        return rm;
30102 
30103     }
30104 
30105     /**
30106     *
30107     *  Transformation from ICRS equatorial coordinates to ecliptic
30108     *  coordinates (mean equinox and ecliptic of date) using a long-term
30109     *  precession model.
30110     *
30111     * <p>This function is derived from the International Astronomical Union's
30112     *  SOFA (Standards of Fundamental Astronomy) software collection.
30113     *
30114     *  <p>Status:  support function.
30115     *
30116     *  <!-- Given: -->
30117     *     @param epj     double     Julian epoch (TT)
30118     *     @param dr   double     ICRS right ascension and declination (radians)
30119     *     @param dd   double     ICRS right ascension and declination (radians)
30120     *
30121     * <!-- Returned: -->
30122     *     @return     ecliptic longitude and latitude (radians)
30123     *<ol>
30124     *  <li> No assumptions are made about whether the coordinates represent
30125     *     starlight and embody astrometric effects such as parallax or
30126     *     aberration.
30127     *
30128     *  <li> The transformation is approximately that from mean J2000.0 right
30129     *     ascension and declination to ecliptic longitude and latitude
30130     *     (mean equinox and ecliptic of date), with only frame bias (always
30131     *     less than 25 mas) to disturb this classical picture.
30132     *
30133     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30134     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30135     *     100 microarcseconds during the 20th and 21st centuries.  It is
30136     *     accurate to a few arcseconds throughout the historical period,
30137     *     worsening to a few tenths of a degree at the end of the
30138     *     +/- 200,000 year time span.
30139     *</ol>
30140     *  Called:<ul>
30141     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
30142     *     <li>{@link #jauLtecm}     J2000.0 to ecliptic rotation matrix, long term
30143     *     <li>{@link #jauRxp}       product of r-matrix and p-vector
30144     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
30145     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
30146     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
30147     *</ul>
30148     *  References:
30149     *
30150     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30151     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30152     *    A22
30153     *
30154     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30155     *    expressions, valid for long time intervals (Corrigendum),
30156     *    Astron.Astrophys. 541, C1
30157     *
30158     *   @version  2016 February 9
30159     *
30160     *  @since JSOFA release 20160503
30161     *
30162     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30163     */
30164     public static SphericalCoordinate jauLteqec(double epj, double dr, double dd)
30165     {
30166 
30167     /* Spherical to Cartesian. */
30168        double v1[] = jauS2c(dr, dd);
30169 
30170     /* Rotation matrix, ICRS equatorial to ecliptic. */
30171        double rm[][] = jauLtecm(epj);
30172 
30173     /* The transformation from ICRS to ecliptic. */
30174        double v2[] = jauRxp(rm, v1);
30175 
30176     /* Cartesian to spherical. */
30177        SphericalCoordinate co = jauC2s(v2);
30178 
30179     /* Express in conventional ranges. */
30180       co.alpha = jauAnp(co.alpha);
30181       co.delta = jauAnpm(co.delta);
30182 
30183      return co;
30184     }
30185 
30186     /**
30187     *
30188     *  Long-term precession matrix.
30189     *
30190     * <p>This function is derived from the International Astronomical Union's
30191     *  SOFA (Standards of Fundamental Astronomy) software collection.
30192     *
30193     *  <p>Status:  support function.
30194     *
30195     *  <!-- Given: -->
30196     *     @param epj     double         Julian epoch (TT)
30197     *
30198     * <!-- Returned: -->
30199     *     @return      double[3][3]   precession matrix, J2000.0 to date
30200     *
30201     *  <p>Notes: <ol>
30202     *
30203     *  <li> The matrix is in the sense
30204     *
30205     *        P_date = rp x P_J2000,
30206     *
30207     *     where P_J2000 is a vector with respect to the J2000.0 mean
30208     *     equator and equinox and P_date is the same vector with respect to
30209     *     the equator and equinox of epoch epj.
30210     *
30211     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30212     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30213     *     100 microarcseconds during the 20th and 21st centuries.  It is
30214     *     accurate to a few arcseconds throughout the historical period,
30215     *     worsening to a few tenths of a degree at the end of the
30216     *     +/- 200,000 year time span.
30217     *</ol>
30218     *  Called:<ul>
30219     *     <li>{@link #jauLtpequ}    equator pole, long term
30220     *     <li>{@link #jauLtpecl}    ecliptic pole, long term
30221     *     <li>{@link #jauPxp}       vector product
30222     *     <li>{@link #jauPn}        normalize vector
30223     *</ul>
30224     *  References:
30225     *
30226     *    <p>Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30227     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30228     *    A22
30229     *
30230     *    <p>Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30231     *    expressions, valid for long time intervals (Corrigendum),
30232     *    Astron.Astrophys. 541, C1
30233     *
30234     *   @version  2015 December 6
30235     *
30236     *  @since JSOFA release 20160503
30237     *
30238     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30239     */
30240     public static double[][] jauLtp(double epj )
30241     {
30242        double rp[][] = new double[3][3];
30243        int i;
30244        
30245 
30246 
30247     /* Equator pole (bottom row of matrix). */
30248        double peqr[] = jauLtpequ(epj);
30249 
30250     /* Ecliptic pole. */
30251        double pecl[] = jauLtpecl(epj);
30252 
30253     /* Equinox (top row of matrix). */
30254        double v[] = jauPxp(peqr, pecl);
30255        NormalizedVector nv = jauPn(v);
30256 
30257     /* Middle row of matrix. */
30258        v = jauPxp(peqr, nv.u);
30259 
30260     /* Assemble the matrix. */
30261        for ( i = 0; i < 3; i++ ) {
30262           rp[0][i] = nv.u[i];
30263           rp[1][i] = v[i];
30264           rp[2][i] = peqr[i];
30265        }
30266 
30267        return rp;
30268     }
30269 
30270 
30271     /**
30272     *
30273     *  Long-term precession matrix, including ICRS frame bias.
30274     *
30275     * <p>This function is derived from the International Astronomical Union's
30276     *  SOFA (Standards of Fundamental Astronomy) software collection.
30277     *
30278     *  <p>Status:  support function.
30279     *
30280     *  <!-- Given: -->
30281     *     @param epj     double         Julian epoch (TT)
30282     *
30283     * <!-- Returned: -->
30284     *     @return     double[3][3]   precession-bias matrix, J2000.0 to date
30285     *
30286     *  <p>Notes: <ol>
30287     *
30288     *  <li> The matrix is in the sense
30289     *
30290     *        P_date = rpb x P_ICRS,
30291     *
30292     *     where P_ICRS is a vector in the International Celestial Reference
30293     *     System, and P_date is the vector with respect to the Celestial
30294     *     Intermediate Reference System at that date but with nutation
30295     *     neglected.
30296     *
30297     *  <li> A first order frame bias formulation is used, of sub-
30298     *     microarcsecond accuracy compared with a full 3D rotation.
30299     *
30300     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30301     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30302     *     100 microarcseconds during the 20th and 21st centuries.  It is
30303     *     accurate to a few arcseconds throughout the historical period,
30304     *     worsening to a few tenths of a degree at the end of the
30305     *     +/- 200,000 year time span.
30306     *</ol>
30307     *  References:
30308     *
30309     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30310     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30311     *    A22
30312     *
30313     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30314     *    expressions, valid for long time intervals (Corrigendum),
30315     *    Astron.Astrophys. 541, C1
30316     *
30317     *   @version  2015 December 6
30318     *
30319     *  @since JSOFA release 20160503
30320     *
30321     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30322     */
30323     public static double[][] jauLtpb(double epj)
30324     {
30325         double rpb[][] = new double[3][3];
30326     /* Frame bias (IERS Conventions 2010, Eqs. 5.21 and 5.33) */
30327        final double dx = -0.016617 * DAS2R,
30328                     de = -0.0068192 * DAS2R,
30329                     dr = -0.0146 * DAS2R;
30330 
30331        int i;
30332       
30333 
30334 
30335     /* Precession matrix. */
30336         double rp[][] = jauLtp(epj);
30337 
30338     /* Apply the bias. */
30339        for ( i = 0; i < 3; i++ ) {
30340           rpb[i][0] =  rp[i][0]    - rp[i][1]*dr + rp[i][2]*dx;
30341           rpb[i][1] =  rp[i][0]*dr + rp[i][1]    + rp[i][2]*de;
30342           rpb[i][2] = -rp[i][0]*dx - rp[i][1]*de + rp[i][2];
30343        }
30344 
30345       return rpb;
30346     }
30347 
30348     /**
30349     *
30350     *  Long-term precession of the ecliptic.
30351     *
30352     * <p>This function is derived from the International Astronomical Union's
30353     *  SOFA (Standards of Fundamental Astronomy) software collection.
30354     *
30355     *  <p>Status:  support function.
30356     *
30357     *  <!-- Given: -->
30358     *     @param epj     double         Julian epoch (TT)
30359     *
30360     * <!-- Returned: -->
30361     *     @return     double[3]      ecliptic pole unit vector
30362     *
30363     *  <p>Notes: <ol>
30364     *
30365     *  <li> The returned vector is with respect to the J2000.0 mean equator
30366     *     and equinox.
30367     *
30368     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30369     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30370     *     100 microarcseconds during the 20th and 21st centuries.  It is
30371     *     accurate to a few arcseconds throughout the historical period,
30372     *     worsening to a few tenths of a degree at the end of the
30373     *     +/- 200,000 year time span.
30374     *</ol>
30375     *  References:
30376     *
30377     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30378     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30379     *    A22
30380     *
30381     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30382     *    expressions, valid for long time intervals (Corrigendum),
30383     *    Astron.Astrophys. 541, C1
30384     *
30385     *   @version  2016 February 9
30386     *
30387     *  @since JSOFA release 20160503
30388     *
30389     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30390     */
30391     public static double[] jauLtpecl(double epj)
30392     {
30393         
30394        double vec[] = new double[3];
30395     /* Obliquity at J2000.0 (radians). */
30396        final double eps0 = 84381.406 * DAS2R;
30397 
30398     /* Polynomial coefficients */
30399         final int NPOL = 4 ;
30400         final double pqpol[][] = {
30401           { 5851.607687,
30402               -0.1189000,
30403               -0.00028913,
30404                0.000000101},
30405           {-1600.886300,
30406                1.1689818,
30407               -0.00000020,
30408               -0.000000437}
30409        };
30410 
30411     /* Periodic coefficients */
30412        final double pqper[][] = {
30413           { 708.15,-5486.751211,-684.661560,  667.666730,-5523.863691},
30414           {2309.00,  -17.127623,2446.283880,-2354.886252, -549.747450},
30415           {1620.00, -617.517403, 399.671049, -428.152441, -310.998056},
30416           { 492.20,  413.442940,-356.652376,  376.202861,  421.535876},
30417           {1183.00,   78.614193,-186.387003,  184.778874,  -36.776172},
30418           { 622.00, -180.732815,-316.800070,  335.321713, -145.278396},
30419           { 882.00,  -87.676083, 198.296701, -185.138669,  -34.744450},
30420           { 547.00,   46.140315, 101.135679, -120.972830,   22.885731}
30421        };
30422        final int NPER = pqper.length;
30423 
30424     /* Miscellaneous */
30425        int i;
30426        double t, p, q, w, a, s, c;
30427 
30428 
30429     /* Centuries since J2000. */
30430        t  = ( epj - 2000.0 ) / 100.0;
30431 
30432     /* Initialize P_A and Q_A accumulators. */
30433        p = 0.0;
30434        q = 0.0;
30435 
30436     /* Periodic terms. */
30437        w = D2PI*t;
30438        for ( i = 0; i < NPER; i++ ) {
30439           a = w/pqper[i][0];
30440           s = sin(a);
30441           c = cos(a);
30442           p += c*pqper[i][1] + s*pqper[i][3];
30443           q += c*pqper[i][2] + s*pqper[i][4];
30444        }
30445 
30446     /* Polynomial terms. */
30447        w = 1.0;
30448        for ( i = 0; i < NPOL; i++ ) {
30449           p += pqpol[0][i]*w;
30450           q += pqpol[1][i]*w;
30451           w *= t;
30452        }
30453 
30454     /* P_A and Q_A (radians). */
30455        p *= DAS2R;
30456        q *= DAS2R;
30457 
30458     /* Form the ecliptic pole vector. */
30459        w = 1.0 - p*p - q*q;
30460        w = w < 0.0 ? 0.0 : sqrt(w);
30461        s = sin(eps0);
30462        c = cos(eps0);
30463        vec[0] = p;
30464        vec[1] = - q*c - w*s;
30465        vec[2] = - q*s + w*c;
30466 
30467        return vec;
30468 
30469     }
30470 
30471     /**
30472     *
30473     *  Long-term precession of the equator.
30474     *
30475     * <p>This function is derived from the International Astronomical Union's
30476     *  SOFA (Standards of Fundamental Astronomy) software collection.
30477     *
30478     *  <p>Status:  support function.
30479     *
30480     *  <!-- Given: -->
30481     *     @param epj     double         Julian epoch (TT)
30482     *
30483     * <!-- Returned: -->
30484     *     @return     double[3]      equator pole unit vector
30485     *
30486     *  <p>Notes: <ol>
30487     *
30488     *  <li> The returned vector is with respect to the J2000.0 mean equator
30489     *     and equinox.
30490     *
30491     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30492     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30493     *     100 microarcseconds during the 20th and 21st centuries.  It is
30494     *     accurate to a few arcseconds throughout the historical period,
30495     *     worsening to a few tenths of a degree at the end of the
30496     *     +/- 200,000 year time span.
30497     *</ol>
30498     *  References:
30499     *
30500     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30501     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30502     *    A22
30503     *
30504     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30505     *    expressions, valid for long time intervals (Corrigendum),
30506     *    Astron.Astrophys. 541, C1
30507     *
30508     *   @version  2016 February 9
30509     *
30510     *  @since JSOFA release 20160503
30511     *
30512     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30513     */
30514     public static double[] jauLtpequ(double epj)
30515     {
30516         double veq[] = new double[3];
30517     /* Polynomial coefficients */
30518        final int NPOL = 4;
30519        final double xypol[][] = {
30520           {  5453.282155,
30521                 0.4252841,
30522                -0.00037173,
30523                -0.000000152},
30524           {-73750.930350,
30525                -0.7675452,
30526                -0.00018725,
30527                 0.000000231}
30528        };
30529 
30530     /* Periodic coefficients */
30531         final double xyper[][] = {
30532           { 256.75, -819.940624,75004.344875,81491.287984, 1558.515853},
30533           { 708.15,-8444.676815,  624.033993,  787.163481, 7774.939698},
30534           { 274.20, 2600.009459, 1251.136893, 1251.296102,-2219.534038},
30535           { 241.45, 2755.175630,-1102.212834,-1257.950837,-2523.969396},
30536           {2309.00, -167.659835,-2660.664980,-2966.799730,  247.850422},
30537           { 492.20,  871.855056,  699.291817,  639.744522, -846.485643},
30538           { 396.10,   44.769698,  153.167220,  131.600209,-1393.124055},
30539           { 288.90, -512.313065, -950.865637, -445.040117,  368.526116},
30540           { 231.10, -819.415595,  499.754645,  584.522874,  749.045012},
30541           {1610.00, -538.071099, -145.188210,  -89.756563,  444.704518},
30542           { 620.00, -189.793622,  558.116553,  524.429630,  235.934465},
30543           { 157.87, -402.922932,  -23.923029,  -13.549067,  374.049623},
30544           { 220.30,  179.516345, -165.405086, -210.157124, -171.330180},
30545           {1200.00,   -9.814756,    9.344131,  -44.919798,  -22.899655}
30546        };
30547        final int NPER = xyper.length;
30548 
30549     /* Miscellaneous */
30550        int i;
30551        double t, x, y, w, a, s, c;
30552 
30553 
30554     /* Centuries since J2000. */
30555        t  = ( epj - 2000.0 ) / 100.0;
30556 
30557     /* Initialize X and Y accumulators. */
30558        x = 0.0;
30559        y = 0.0;
30560 
30561     /* Periodic terms. */
30562        w = D2PI * t;
30563        for ( i = 0; i < NPER; i++ ) {
30564           a = w / xyper[i][0];
30565           s = sin(a);
30566           c = cos(a);
30567           x += c*xyper[i][1] + s*xyper[i][3];
30568           y += c*xyper[i][2] + s*xyper[i][4];
30569        }
30570 
30571     /* Polynomial terms. */
30572        w = 1.0;
30573        for ( i = 0; i < NPOL; i++ ) {
30574           x += xypol[0][i]*w;
30575           y += xypol[1][i]*w;
30576           w *= t;
30577        }
30578 
30579     /* X and Y (direction cosines). */
30580        x *= DAS2R;
30581        y *= DAS2R;
30582 
30583     /* Form the equator pole vector. */
30584        veq[0] = x;
30585        veq[1] = y;
30586        w = 1.0 - x*x - y*y;
30587        veq[2] = w < 0.0 ? 0.0 : sqrt(w);
30588 
30589        
30590        return veq;
30591 
30592     }
30593 
30594     /**
30595      * Position consisting of (ha, declination) pairs in radians. Where ha is hour angle and dec is declination .
30596      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
30597      * 
30598      * @since JSOFA release 20180130
30599      */
30600     public static class EquatorialCoordinate {
30601         public double ha;
30602         public double dec;
30603         public EquatorialCoordinate(double ha, double dec){
30604             this.ha = ha;
30605             this.dec = dec;
30606         }
30607     }
30608 
30609     /**
30610      *
30611      *  Horizon to equatorial coordinates:  transform azimuth and altitude
30612      *  to hour angle and declination.
30613      *
30614      * <!-- Given: -->
30615      *  @param  az       double       azimuth
30616      *  @param  el       double       altitude (informally, elevation)
30617      *  @param  phi      double       site latitude
30618      *
30619      * <!-- Returned: -->
30620      *  @return   ha       double       hour angle (local)
30621      *     dec      double       declination
30622      *
30623      * <p>Notes: <ol>
30624      *
30625      * <li>  All the arguments are angles in radians.
30626      *
30627      * <li>  The sign convention for azimuth is north zero, east +pi/2.
30628      *
30629      * <li>  HA is returned in the range +/-pi.  Declination is returned in
30630      *      the range +/-pi/2.
30631      *
30632      * <li>  The latitude phi is pi/2 minus the angle between the Earth's
30633      *      rotation axis and the adopted zenith.  In many applications it
30634      *      will be sufficient to use the published geodetic latitude of the
30635      *      site.  In very precise (sub-arcsecond) applications, phi can be
30636      *      corrected for polar motion.
30637      *
30638      * <li>  The azimuth az must be with respect to the rotational north pole,
30639      *      as opposed to the ITRS pole, and an azimuth with respect to north
30640      *      on a map of the Earth's surface will need to be adjusted for
30641      *      polar motion if sub-arcsecond accuracy is required.
30642      *
30643      * <li>  Should the user wish to work with respect to the astronomical
30644      *      zenith rather than the geodetic zenith, phi will need to be
30645      *      adjusted for deflection of the vertical (often tens of
30646      *      arcseconds), and the zero point of ha will also be affected.
30647      *
30648      * <li>  The transformation is the same as Ve = Ry(phi-pi/2)*Rz(pi)*Vh,
30649      *      where Ve and Vh are lefthanded unit vectors in the (ha,dec) and
30650      *      (az,el) systems respectively and Rz and Ry are rotations about
30651      *      first the z-axis and then the y-axis.  (n.b. Rz(pi) simply
30652      *      reverses the signs of the x and y components.)  For efficiency,
30653      *      the algorithm is written out rather than calling other utility
30654      *      functions.  For applications that require even greater
30655      *      efficiency, additional savings are possible if constant terms
30656      *      such as functions of latitude are computed once and for all.
30657      *
30658      * <li>  Again for efficiency, no range checking of arguments is carried
30659      *      out.
30660      *</ol>
30661      *  Last revision:   2017 September 12
30662      *
30663      * @since JSOFA release 20180130
30664      *
30665      */
30666 
30667     public static  EquatorialCoordinate jauAe2hd (double az, double el, double phi)
30668     {
30669         double sa, ca, se, ce, sp, cp, x, y, z, r;
30670 
30671 
30672         /* Useful trig functions. */
30673         sa = sin(az);
30674         ca = cos(az);
30675         se = sin(el);
30676         ce = cos(el);
30677         sp = sin(phi);
30678         cp = cos(phi);
30679 
30680         /* HA,Dec unit vector. */
30681         x = - ca*ce*sp + se*cp;
30682         y = - sa*ce;
30683         z = ca*ce*cp + se*sp;
30684 
30685         /* To spherical. */
30686         r = sqrt(x*x + y*y);
30687         return new EquatorialCoordinate( (r != 0.0) ? atan2(y,x) : 0.0,
30688                 atan2(z,r));
30689 
30690         /* Finished. */
30691     }
30692 
30693 
30694     /**
30695      * Position consisting of (az, el) pairs in radians. Where az is the azimuth and el is elevation .
30696      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
30697      * 
30698      * @since JSOFA release 20180130
30699      */
30700     public static class HorizonCoordinate {
30701         public double az;
30702         public double el;
30703         public HorizonCoordinate(double az, double el){
30704             this.az = az;
30705             this.el = el;
30706         }
30707     }
30708 
30709 
30710     /**
30711      *
30712      *  Equatorial to horizon coordinates:  transform hour angle and
30713      *  declination to azimuth and altitude.
30714      *
30715      *  <p>This function is derived from the International Astronomical Union's
30716      *  SOFA (Standards of Fundamental Astronomy) software collection.
30717      *
30718      *  <p>Status:  support function.
30719      *
30720      * <!-- Given: -->
30721      *  @param   ha       double       hour angle (local)
30722      *  @param   dec      double       declination
30723      *  @param   phi      double       site latitude
30724      *
30725      * <!-- Returned: -->
30726      *  @return   az      double       azimuth
30727      *     el      double       altitude (informally, elevation)
30728      *
30729      * <p>Notes: <ol>
30730      *
30731      * <li>  All the arguments are angles in radians.
30732      *
30733      * <li>  Azimuth is returned in the range 0-2pi;  north is zero, and east
30734      *      is +pi/2.  Altitude is returned in the range +/- pi/2.
30735      *
30736      * <li>  The latitude phi is pi/2 minus the angle between the Earth's
30737      *      rotation axis and the adopted zenith.  In many applications it
30738      *      will be sufficient to use the published geodetic latitude of the
30739      *      site.  In very precise (sub-arcsecond) applications, phi can be
30740      *      corrected for polar motion.
30741      *
30742      * <li>  The returned azimuth az is with respect to the rotational north
30743      *      pole, as opposed to the ITRS pole, and for sub-arcsecond
30744      *      accuracy will need to be adjusted for polar motion if it is to
30745      *      be with respect to north on a map of the Earth's surface.
30746      *
30747      * <li>  Should the user wish to work with respect to the astronomical
30748      *      zenith rather than the geodetic zenith, phi will need to be
30749      *      adjusted for deflection of the vertical (often tens of
30750      *      arcseconds), and the zero point of the hour angle ha will also
30751      *      be affected.
30752      *
30753      * <li>  The transformation is the same as Vh = Rz(pi)*Ry(pi/2-phi)*Ve,
30754      *      where Vh and Ve are lefthanded unit vectors in the (az,el) and
30755      *      (ha,dec) systems respectively and Ry and Rz are rotations about
30756      *      first the y-axis and then the z-axis.  (n.b. Rz(pi) simply
30757      *      reverses the signs of the x and y components.)  For efficiency,
30758      *      the algorithm is written out rather than calling other utility
30759      *      functions.  For applications that require even greater
30760      *      efficiency, additional savings are possible if constant terms
30761      *      such as functions of latitude are computed once and for all.
30762      *
30763      * <li>  Again for efficiency, no range checking of arguments is carried
30764      *      out.
30765      *</ol>
30766      *  Last revision:   2017 September 12
30767      *
30768      * @since JSOFA release 20180130
30769      *
30770      */
30771     public static HorizonCoordinate jauHd2ae (double ha, double dec, double phi)
30772     {
30773         double sh, ch, sd, cd, sp, cp, x, y, z, r, a;
30774 
30775 
30776         /* Useful trig functions. */
30777         sh = sin(ha);
30778         ch = cos(ha);
30779         sd = sin(dec);
30780         cd = cos(dec);
30781         sp = sin(phi);
30782         cp = cos(phi);
30783 
30784         /* Az,Alt unit vector. */
30785         x = - ch*cd*sp + sd*cp;
30786         y = - sh*cd;
30787         z = ch*cd*cp + sd*sp;
30788 
30789         /* To spherical. */
30790         r = sqrt(x*x + y*y);
30791         a = (r != 0.0) ? atan2(y,x) : 0.0;
30792         return new HorizonCoordinate((a < 0.0) ? a+D2PI : a,
30793                 atan2(z,r));
30794 
30795         /* Finished. */
30796     }
30797 
30798 
30799     /**
30800      *
30801      *  Parallactic angle for a given hour angle and declination.
30802      *
30803      *  <p>This function is derived from the International Astronomical Union's
30804      *  SOFA (Standards of Fundamental Astronomy) software collection.
30805      *
30806      *  <p>Status:  support function.
30807      *
30808      * <!-- Given: -->
30809      *  @param  ha     double     hour angle
30810      *  @param  dec    double     declination
30811      *  @param  phi    double     site latitude
30812      *
30813      *  @return     double     parallactic angle
30814      *
30815      * <p>Notes: <ol>
30816      *
30817      * <li>  All the arguments are angles in radians.
30818      *
30819      * <li>  The parallactic angle at a point in the sky is the position
30820      *      angle of the vertical, i.e. the angle between the directions to
30821      *      the north celestial pole and to the zenith respectively.
30822      *
30823      * <li>  The result is returned in the range -pi to +pi.
30824      *
30825      * <li>  At the pole itself a zero result is returned.
30826      *
30827      * <li>  The latitude phi is pi/2 minus the angle between the Earth's
30828      *      rotation axis and the adopted zenith.  In many applications it
30829      *      will be sufficient to use the published geodetic latitude of the
30830      *      site.  In very precise (sub-arcsecond) applications, phi can be
30831      *      corrected for polar motion.
30832      *
30833      * <li>  Should the user wish to work with respect to the astronomical
30834      *      zenith rather than the geodetic zenith, phi will need to be
30835      *      adjusted for deflection of the vertical (often tens of
30836      *      arcseconds), and the zero point of the hour angle ha will also
30837      *      be affected.
30838      *</ol>
30839      *  Reference:
30840      *     Smart, W.M., "Spherical Astronomy", Cambridge University Press,
30841      *     6th edition (Green, 1977), p49.
30842      *
30843      *  Last revision:   2017 September 12
30844      *
30845      * @since JSOFA release 20180130
30846      *
30847      */
30848     public static double jauHd2pa (double ha, double dec, double phi)
30849     {
30850         double cp, cqsz, sqsz;
30851 
30852 
30853         cp = cos(phi);
30854         sqsz = cp*sin(ha);
30855         cqsz = sin(phi)*cos(dec) - cp*sin(dec)*cos(ha);
30856         return ( ( sqsz != 0.0 || cqsz != 0.0 ) ? atan2(sqsz,cqsz) : 0.0 );
30857 
30858         /* Finished. */
30859     }
30860 
30861 
30862     /**
30863      * Tangent point soulutions. A class to contain tangent point soutions and an indication as to how many of the solutions are valid
30864      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
30865      * @since JSOFA release 20180130
30866      */
30867     public static class TangentPointSolution
30868     {
30869         public SphericalCoordinate sol1;
30870         public SphericalCoordinate sol2;
30871 
30872         /** nsolutions. The number of useful solutions
30873          */
30874         public int nsolutions;
30875         /**
30876          * @param sol1
30877          * @param sol2
30878          * @param flag
30879 
30880          */
30881         public TangentPointSolution(SphericalCoordinate sol1,
30882                 SphericalCoordinate sol2, int flag) {
30883             this.sol1 = sol1;
30884             this.sol2 = sol2;
30885             this.nsolutions = flag;
30886         }
30887         public TangentPointSolution()
30888         {
30889             this.sol1 = null;
30890             this.sol2 = null;
30891             this.nsolutions = 0;
30892         }
30893     }
30894     /**
30895      *
30896      *  In the tangent plane projection, given the rectangular coordinates
30897      *  of a star and its spherical coordinates, determine the spherical
30898      *  coordinates of the tangent point.
30899      *
30900      *  <p>This function is derived from the International Astronomical Union's
30901      *  SOFA (Standards of Fundamental Astronomy) software collection.
30902      *
30903      *  <p>Status:  support function.
30904      *
30905      * <!-- Given: -->
30906      *   @param  xi     double  rectangular coordinates of star image (Note 2)
30907      *   @param  eta     double  rectangular coordinates of star image (Note 2)
30908      *   @param  a        double  star's spherical coordinates (Note 3)
30909      *   @param  b        double  star's spherical coordinates (Note 3)
30910      *
30911      * <!-- Returned: -->
30912      *     @return  tangent point's spherical coordinate solutions
30913      *
30914      *  Returned (function value):
30915      *                int     number of solutions:
30916      *                        0 = no solutions returned (Note 5)
30917      *                        1 = only the first solution is useful (Note 6)
30918      *                        2 = both solutions are useful (Note 6)
30919      *
30920      * <p>Notes: <ol>
30921      *
30922      * <li> The tangent plane projection is also called the "gnomonic
30923      *     projection" and the "central projection".
30924      *
30925      * <li> The eta axis points due north in the adopted coordinate system.
30926      *     If the spherical coordinates are observed (RA,Dec), the tangent
30927      *     plane coordinates (xi,eta) are conventionally called the
30928      *     "standard coordinates".  If the spherical coordinates are with
30929      *     respect to a right-handed triad, (xi,eta) are also right-handed.
30930      *     The units of (xi,eta) are, effectively, radians at the tangent
30931      *     point.
30932      *
30933      * <li> All angular arguments are in radians.
30934      *
30935      * <li> The angles a01 and a02 are returned in the range 0-2pi.  The
30936      *     angles b01 and b02 are returned in the range +/-pi, but in the
30937      *     usual, non-pole-crossing, case, the range is +/-pi/2.
30938      *
30939      * <li> Cases where there is no solution can arise only near the poles.
30940      *     For example, it is clearly impossible for a star at the pole
30941      *     itself to have a non-zero xi value, and hence it is meaningless
30942      *     to ask where the tangent point would have to be to bring about
30943      *     this combination of xi and dec.
30944      *
30945      * <li> Also near the poles, cases can arise where there are two useful
30946      *     solutions.  The return value indicates whether the second of the
30947      *     two solutions returned is useful;  1 indicates only one useful
30948      *     solution, the usual case.
30949      *
30950      * <li> The basis of the algorithm is to solve the spherical triangle PSC,
30951      *     where P is the north celestial pole, S is the star and C is the
30952      *     tangent point.  The spherical coordinates of the tangent point are
30953      *     [a0,b0];  writing rho^2 = (xi^2+eta^2) and r^2 = (1+rho^2), side c
30954      *     is then (pi/2-b), side p is sqrt(xi^2+eta^2) and side s (to be
30955      *     found) is (pi/2-b0).  Angle C is given by sin(C) = xi/rho and
30956      *     cos(C) = eta/rho.  Angle P (to be found) is the longitude
30957      *     difference between star and tangent point (a-a0).
30958      *
30959      * <li> This function is a member of the following set:
30960      * 
30961      *{@code
30962      *         spherical      vector         solve for
30963      *
30964      *         iauTpxes      iauTpxev         xi,eta
30965      *         iauTpsts      iauTpstv          star
30966      *       > iauTpors <    iauTporv         origin
30967      *}
30968      *</ol>
30969      *  Called:
30970      *     iauAnp       normalize angle into range 0 to 2pi
30971      *
30972      *  References:
30973      *
30974      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
30975      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
30976      *
30977      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
30978      *     1987, Chapter 13.
30979      *
30980      * @version   2018 January 2
30981      *
30982      * @since JSOFA release 20180130
30983      *
30984      */
30985     public static TangentPointSolution jauTpors(double xi, double eta, double a, double b)
30986     {
30987         double xi2, r, sb, cb, rsb, rcb, w2, w, s, c;
30988         double a01, b01, a02, b02;
30989 
30990 
30991         xi2 = xi*xi;
30992         r = sqrt(1.0 + xi2 + eta*eta);
30993         sb = sin(b);
30994         cb = cos(b);
30995         rsb = r*sb;
30996         rcb = r*cb;
30997         w2 = rcb*rcb - xi2;
30998         if ( w2 >= 0.0 ) {
30999             w = sqrt(w2);
31000             s = rsb - eta*w;
31001             c = rsb*eta + w;
31002             if ( xi == 0.0 && w == 0.0 ) w = 1.0;
31003             a01 = jauAnp(a - atan2(xi,w));
31004             b01 = atan2(s,c);
31005             w = -w;
31006             s = rsb - eta*w;
31007             c = rsb*eta + w;
31008             a02 = jauAnp(a - atan2(xi,w));
31009             b02 = atan2(s,c);
31010             return new TangentPointSolution(new SphericalCoordinate(a01, b01), new SphericalCoordinate(a02, b02), 
31011                     (abs(rsb) < 1.0) ? 1 : 2);
31012         } else {
31013             return new TangentPointSolution();
31014         }
31015 
31016         /* Finished. */
31017 
31018     }
31019 
31020     /**
31021      * Tangent point soutions as direction cosines. A container class for two possible solutiuons as well as an indication of the number of valid solutions.
31022      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
31023      * @since 27 Mar 2018
31024      */
31025     public static class TangentPointDirectionCosines {
31026         public double dc1[];
31027         public double dc2[];
31028         /** nsolution. number of valid solutions.
31029          */
31030         public int nsolution;
31031         /**
31032          * @param dc1 direction cosines 
31033          * @param dc2 direction cosines
31034          * @param nsolution number of valid solutions
31035          */
31036         public TangentPointDirectionCosines(double[] dc1, double[] dc2,
31037                 int nsolution) {
31038             this.dc1 = dc1;
31039             this.dc2 = dc2;
31040             this.nsolution = nsolution;
31041         }
31042         /**
31043          * 
31044          */
31045         public TangentPointDirectionCosines() {
31046             this.nsolution = 0;
31047         }
31048 
31049     }
31050     /**
31051      *
31052      *  In the tangent plane projection, given the rectangular coordinates
31053      *  of a star and its direction cosines, determine the direction
31054      *  cosines of the tangent point.
31055      *
31056      *  <p>This function is derived from the International Astronomical Union's
31057      *  SOFA (Standards of Fundamental Astronomy) software collection.
31058      *
31059      *  <p>Status:  support function.
31060      *
31061      * <!-- Given: -->
31062      *     @param xi   double    rectangular coordinates of star image (Note 2)
31063      *     @param eta     double    rectangular coordinates of star image (Note 2)
31064      *     @param v        double[3] star's direction cosines (Note 3)
31065      *
31066      * <!-- Returned: -->
31067      *     @return       tangent point's direction cosines, Solutions 1 &amp; 2 
31068      *                   int     number of solutions:
31069      *                        0 = no solutions returned (Note 4)
31070      *                        1 = only the first solution is useful (Note 5)
31071      *                        2 = both solutions are useful (Note 5)
31072      *
31073      * <p>Notes: <ol>
31074      *
31075      * <li> The tangent plane projection is also called the "gnomonic
31076      *     projection" and the "central projection".
31077      *
31078      * <li> The eta axis points due north in the adopted coordinate system.
31079      *     If the direction cosines represent observed (RA,Dec), the tangent
31080      *     plane coordinates (xi,eta) are conventionally called the
31081      *     "standard coordinates".  If the direction cosines are with
31082      *     respect to a right-handed triad, (xi,eta) are also right-handed.
31083      *     The units of (xi,eta) are, effectively, radians at the tangent
31084      *     point.
31085      *
31086      * <li> The vector v must be of unit length or the result will be wrong.
31087      *
31088      * <li> Cases where there is no solution can arise only near the poles.
31089      *     For example, it is clearly impossible for a star at the pole
31090      *     itself to have a non-zero xi value, and hence it is meaningless
31091      *     to ask where the tangent point would have to be.
31092      *
31093      * <li> Also near the poles, cases can arise where there are two useful
31094      *     solutions.  The return value indicates whether the second of the
31095      *     two solutions returned is useful;  1 indicates only one useful
31096      *     solution, the usual case.
31097      *
31098      * <li> The basis of the algorithm is to solve the spherical triangle
31099      *     PSC, where P is the north celestial pole, S is the star and C is
31100      *     the tangent point.  Calling the celestial spherical coordinates
31101      *     of the star and tangent point (a,b) and (a0,b0) respectively, and
31102      *     writing rho^2 = (xi^2+eta^2) and r^2 = (1+rho^2), and
31103      *     transforming the vector v into (a,b) in the normal way, side c is
31104      *     then (pi/2-b), side p is sqrt(xi^2+eta^2) and side s (to be
31105      *     found) is (pi/2-b0), while angle C is given by sin(C) = xi/rho
31106      *     and cos(C) = eta/rho;  angle P (to be found) is (a-a0).  After
31107      *     solving the spherical triangle, the result (a0,b0) can be
31108      *     expressed in vector form as v0.
31109      *
31110      * <li> This function is a member of the following set:
31111      * {@code
31112      *         spherical      vector         solve for
31113      *
31114      *         iauTpxes      iauTpxev         xi,eta
31115      *         iauTpsts      iauTpstv          star
31116      *         iauTpors    > iauTporv <       origin
31117      * }
31118      *</ol>
31119      *  References:
31120      *
31121      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31122      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31123      *
31124      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31125      *     1987, Chapter 13.
31126      *
31127      * @version   2018 January 2
31128      *
31129      * @since JSOFA release 20180130
31130      *
31131      */
31132 
31133     public static TangentPointDirectionCosines jauTporv(double xi, double eta, double v[])
31134     {
31135         double x, y, z, rxy2, xi2, eta2p1, r, rsb, rcb, w2, w, c;
31136         double v01[] = new double[3];
31137         double v02[] = new double[3];
31138 
31139         x = v[0];
31140         y = v[1];
31141         z = v[2];
31142         rxy2 = x*x + y*y;
31143         xi2 = xi*xi;
31144         eta2p1 = eta*eta + 1.0;
31145         r = sqrt(xi2 + eta2p1);
31146         rsb = r*z;
31147         rcb = r*sqrt(x*x + y*y);
31148         w2 = rcb*rcb - xi2;
31149         if ( w2 > 0.0 ) {
31150             w = sqrt(w2);
31151             c = (rsb*eta + w) / (eta2p1*sqrt(rxy2*(w2+xi2)));
31152             v01[0] = c * (x*w + y*xi);
31153             v01[1] = c * (y*w - x*xi);
31154             v01[2] = (rsb - eta*w) / eta2p1;
31155             w = - w;
31156             c = (rsb*eta + w) / (eta2p1*sqrt(rxy2*(w2+xi2)));
31157             v02[0] = c * (x*w + y*xi);
31158             v02[1] = c * (y*w - x*xi);
31159             v02[2] = (rsb - eta*w) / eta2p1;
31160             return new TangentPointDirectionCosines(v01,v02,(abs(rsb) < 1.0) ? 1 : 2);
31161         } else {
31162             return new TangentPointDirectionCosines();
31163         }
31164 
31165         /* Finished. */
31166     }
31167 
31168     /**
31169      *
31170      *  In the tangent plane projection, given the star's rectangular
31171      *  coordinates and the spherical coordinates of the tangent point,
31172      *  solve for the spherical coordinates of the star.
31173      *
31174      *  <p>This function is derived from the International Astronomical Union's
31175      *  SOFA (Standards of Fundamental Astronomy) software collection.
31176      *
31177      *  <p>Status:  support function.
31178      *
31179      * <!-- Given: -->
31180      *     @param xi    double  rectangular coordinates of star image (Note 2)
31181      *     @param eta    double  rectangular coordinates of star image (Note 2)
31182      *     @param a0     double  tangent point's spherical coordinates
31183      *     @param b0     double  tangent point's spherical coordinates
31184      *
31185      * <!-- Returned: -->
31186      *     @return     star's spherical coordinates
31187      *<ol>
31188      * <li> The tangent plane projection is also called the "gnomonic
31189      *     projection" and the "central projection".
31190      *
31191      * <li> The eta axis points due north in the adopted coordinate system.
31192      *     If the spherical coordinates are observed (RA,Dec), the tangent
31193      *     plane coordinates (xi,eta) are conventionally called the
31194      *     "standard coordinates".  If the spherical coordinates are with
31195      *     respect to a right-handed triad, (xi,eta) are also right-handed.
31196      *     The units of (xi,eta) are, effectively, radians at the tangent
31197      *     point.
31198      *
31199      * <li> All angular arguments are in radians.
31200      *
31201      * <li> This function is a member of the following set:
31202      *{@code
31203      *         spherical      vector         solve for
31204      *
31205      *         iauTpxes      iauTpxev         xi,eta
31206      *       > iauTpsts <    iauTpstv          star
31207      *         iauTpors      iauTporv         origin
31208      * }
31209      *</ol>
31210      *  Called:
31211      *     iauAnp       normalize angle into range 0 to 2pi
31212      *
31213      *  References:
31214      *
31215      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31216      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31217      *
31218      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31219      *     1987, Chapter 13.
31220      *
31221      * @version   2018 January 2
31222      *
31223      * @since JSOFA release 20180130
31224      *
31225      */
31226     public static SphericalCoordinate jauTpsts(double xi, double eta, double a0, double b0)
31227     {
31228         double sb0, cb0, d;
31229 
31230         sb0 = sin(b0);
31231         cb0 = cos(b0);
31232         d = cb0 - eta*sb0;
31233         return new SphericalCoordinate( jauAnp(atan2(xi,d) + a0),
31234                 atan2(sb0+eta*cb0, sqrt(xi*xi+d*d)));
31235 
31236         /* Finished. */
31237     }
31238 
31239     /**
31240      * Tangent Plane Position consisting of (xi, eta) pairs in radians.
31241      * 
31242      * 
31243      * <p>Notes: <ol>
31244      *
31245      * <li> The tangent plane projection is also called the "gnomonic
31246      *     projection" and the "central projection".
31247      *
31248      * <li> The eta axis points due north in the adopted coordinate system.
31249      *     If the spherical coordinates are observed (RA,Dec), the tangent
31250      *     plane coordinates (xi,eta) are conventionally called the
31251      *     "standard coordinates".  For right-handed spherical coordinates,
31252      *     (xi,eta) are also right-handed.  The units of (xi,eta) are,
31253      *     effectively, radians at the tangent point.
31254      *     </ol>
31255      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
31256      * 
31257      * @since JSOFA release 20180130
31258      */
31259     public static class TangentPlaneCoordinate {
31260         public double xi;
31261         public double eta;
31262         /** status.
31263          *                         0 = OK
31264          *                                1 = star too far from axis
31265          *                                2 = antistar on tangent plane
31266          *                                3 = antistar too far from axis
31267          */
31268         public int status;
31269         public TangentPlaneCoordinate(double xi, double eta, int j){
31270             this.xi = xi;
31271             this.eta = eta;
31272             this.status = j;
31273         }
31274     }
31275 
31276 
31277     /**
31278      *
31279      *  In the tangent plane projection, given the star's rectangular
31280      *  coordinates and the direction cosines of the tangent point, solve
31281      *  for the direction cosines of the star.
31282      *
31283      *  <p>This function is derived from the International Astronomical Union's
31284      *  SOFA (Standards of Fundamental Astronomy) software collection.
31285      *
31286      *  <p>Status:  support function.
31287      *
31288      * <!-- Given: -->
31289      *     @param xi  double     rectangular coordinates of star image (Note 2)
31290      *     @param eta  double     rectangular coordinates of star image (Note 2)
31291      *     @param v0      double[3]  tangent point's direction cosines
31292      *
31293      * <!-- Returned: -->
31294      *     @return      double[3]  star's direction cosines
31295      * <ol>
31296      * <li> The tangent plane projection is also called the "gnomonic
31297      *     projection" and the "central projection".
31298      *
31299      * <li> The eta axis points due north in the adopted coordinate system.
31300      *     If the direction cosines represent observed (RA,Dec), the tangent
31301      *     plane coordinates (xi,eta) are conventionally called the
31302      *     "standard coordinates".  If the direction cosines are with
31303      *     respect to a right-handed triad, (xi,eta) are also right-handed.
31304      *     The units of (xi,eta) are, effectively, radians at the tangent
31305      *     point.
31306      *
31307      * <li> The method used is to complete the star vector in the (xi,eta)
31308      *     based triad and normalize it, then rotate the triad to put the
31309      *     tangent point at the pole with the x-axis aligned to zero
31310      *     longitude.  Writing (a0,b0) for the celestial spherical
31311      *     coordinates of the tangent point, the sequence of rotations is
31312      *     (b-pi/2) around the x-axis followed by (-a-pi/2) around the
31313      *     z-axis.
31314      *
31315      * <li> If vector v0 is not of unit length, the returned vector v will
31316      *     be wrong.
31317      *
31318      * <li> If vector v0 points at a pole, the returned vector v will be
31319      *     based on the arbitrary assumption that the longitude coordinate
31320      *     of the tangent point is zero.
31321      *
31322      * <li> This function is a member of the following set:
31323      *{@code
31324      *         spherical      vector         solve for
31325      *
31326      *         iauTpxes      iauTpxev         xi,eta
31327      *         iauTpsts    > iauTpstv <        star
31328      *         iauTpors      iauTporv         origin
31329      * }
31330      *</ol>
31331      *  References:
31332      *
31333      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31334      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31335      *
31336      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31337      *     1987, Chapter 13.
31338      *
31339      * @version   2018 January 2
31340      *
31341      * @since JSOFA release 20180130
31342      *
31343      */
31344     public static double[] jauTpstv(double xi, double eta, double v0[])
31345     {
31346         double x, y, z, f, r;
31347         double v[] = new double[3];
31348 
31349 
31350         /* Tangent point. */
31351         x = v0[0];
31352         y = v0[1];
31353         z = v0[2];
31354 
31355         /* Deal with polar case. */
31356         r = sqrt(x*x + y*y);
31357         if ( r == 0.0 ) {
31358             r = 1e-20;
31359             x = r;
31360         }
31361 
31362         /* Star vector length to tangent plane. */
31363         f = sqrt(1.0 + xi*xi + eta*eta);
31364 
31365         /* Apply the transformation and normalize. */
31366         v[0] = (x - (xi*y + eta*x*z) / r) / f;
31367         v[1] = (y + (xi*x - eta*y*z) / r) / f;
31368         v[2] = (z + eta*r) / f;
31369         return v;
31370 
31371         /* Finished. */
31372 
31373     }
31374 
31375     /**
31376      *
31377      *  In the tangent plane projection, given celestial spherical
31378      *  coordinates for a star and the tangent point, solve for the star's
31379      *  rectangular coordinates in the tangent plane.
31380      *
31381      *  <p>This function is derived from the International Astronomical Union's
31382      *  SOFA (Standards of Fundamental Astronomy) software collection.
31383      *
31384      *  <p>Status:  support function.
31385      *
31386      * <!-- Given: -->
31387      *     @param a       double  star's spherical coordinates
31388      *     @param b       double  star's spherical coordinates
31389      *     @param a0     double  tangent point's spherical coordinates
31390      *     @param b0     double  tangent point's spherical coordinates
31391      *
31392      * <!-- Returned: -->
31393      *     @return  rectangular coordinates of star image (Note 2)
31394       *               int     status:  0 = OK
31395      *                                1 = star too far from axis
31396      *                                2 = antistar on tangent plane
31397      *                                3 = antistar too far from axis
31398      *
31399      * <p>Notes: <ol>
31400      *
31401      * <li> The tangent plane projection is also called the "gnomonic
31402      *     projection" and the "central projection".
31403      *
31404      * <li> The eta axis points due north in the adopted coordinate system.
31405      *     If the spherical coordinates are observed (RA,Dec), the tangent
31406      *     plane coordinates (xi,eta) are conventionally called the
31407      *     "standard coordinates".  For right-handed spherical coordinates,
31408      *     (xi,eta) are also right-handed.  The units of (xi,eta) are,
31409      *     effectively, radians at the tangent point.
31410      *
31411      * <li> All angular arguments are in radians.
31412      *
31413      * <li> This function is a member of the following set:
31414      *{@code
31415      *         spherical      vector         solve for
31416      *
31417      *       > iauTpxes <    iauTpxev         xi,eta
31418      *         iauTpsts      iauTpstv          star
31419      *         iauTpors      iauTporv         origin
31420      *}
31421      *</ol>
31422      *  References:
31423      *
31424      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31425      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31426      *
31427      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31428      *     1987, Chapter 13.
31429      *
31430      * @version   2018 January 2
31431      *
31432      * @since JSOFA release 20180130
31433      *
31434      */
31435     public static TangentPlaneCoordinate jauTpxes(double a, double b, double a0, double b0)
31436     {
31437         int j;
31438         double sb0, sb, cb0, cb, da, sda, cda, d;
31439 
31440 
31441         /* Functions of the spherical coordinates. */
31442         sb0 = sin(b0);
31443         sb = sin(b);
31444         cb0 = cos(b0);
31445         cb = cos(b);
31446         da = a - a0;
31447         sda = sin(da);
31448         cda = cos(da);
31449 
31450         /* Reciprocal of star vector length to tangent plane. */
31451         d = sb*sb0 + cb*cb0*cda;
31452 
31453         /* Check for error cases. */
31454         if ( d > TANGENT_TINY ) {
31455             j = 0;
31456         } else if ( d >= 0.0 ) {
31457             j = 1;
31458             d = TANGENT_TINY;
31459         } else if ( d > -TANGENT_TINY ) {
31460             j = 2;
31461             d = -TANGENT_TINY;
31462         } else {
31463             j = 3;
31464         }
31465 
31466         /* Return the tangent plane coordinates (even in dubious cases). */
31467         return new TangentPlaneCoordinate( cb*sda / d,
31468                 (sb*cb0 - cb*sb0*cda) / d, j);
31469 
31470 
31471         /* Finished. */
31472     }
31473 
31474     /**
31475      *
31476      *  In the tangent plane projection, given celestial direction cosines
31477      *  for a star and the tangent point, solve for the star's rectangular
31478      *  coordinates in the tangent plane.
31479      *
31480      *  <p>This function is derived from the International Astronomical Union's
31481      *  SOFA (Standards of Fundamental Astronomy) software collection.
31482      *
31483      *  <p>Status:  support function.
31484      *
31485      * <!-- Given: -->
31486      *     @param v         double[3]  direction cosines of star (Note 4)
31487      *     @param v0        double[3]  direction cosines of tangent point (Note 4)
31488      *
31489      * <!-- Returned: -->
31490      *     @return     tangent plane coordinates of star
31491      *               int        status: 0 = OK
31492      *                                  1 = star too far from axis
31493      *                                  2 = antistar on tangent plane
31494      *                                  3 = antistar too far from axis
31495      *
31496      * <p>Notes: <ol>
31497      *
31498      * <li> The tangent plane projection is also called the "gnomonic
31499      *     projection" and the "central projection".
31500      *
31501      * <li> The eta axis points due north in the adopted coordinate system.
31502      *     If the direction cosines represent observed (RA,Dec), the tangent
31503      *     plane coordinates (xi,eta) are conventionally called the
31504      *     "standard coordinates".  If the direction cosines are with
31505      *     respect to a right-handed triad, (xi,eta) are also right-handed.
31506      *     The units of (xi,eta) are, effectively, radians at the tangent
31507      *     point.
31508      *
31509      * <li> The method used is to extend the star vector to the tangent
31510      *     plane and then rotate the triad so that (x,y) becomes (xi,eta).
31511      *     Writing (a,b) for the celestial spherical coordinates of the
31512      *     star, the sequence of rotations is (a+pi/2) around the z-axis
31513      *     followed by (pi/2-b) around the x-axis.
31514      *
31515      * <li> If vector v0 is not of unit length, or if vector v is of zero
31516      *     length, the results will be wrong.
31517      *
31518      * <li> If v0 points at a pole, the returned (xi,eta) will be based on
31519      *     the arbitrary assumption that the longitude coordinate of the
31520      *     tangent point is zero.
31521      *
31522      * <li> This function is a member of the following set:
31523      *{@code
31524      *         spherical      vector         solve for
31525      *
31526      *         iauTpxes    > iauTpxev <       xi,eta
31527      *         iauTpsts      iauTpstv          star
31528      *         iauTpors      iauTporv         origin
31529      * }
31530      *</ol>
31531      *  References:
31532      *
31533      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31534      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31535      *
31536      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31537      *     1987, Chapter 13.
31538      *
31539      * @version   2018 January 2
31540      *
31541      * @since JSOFA release 20180130
31542      *
31543      */
31544     public static TangentPlaneCoordinate jauTpxev(double v[], double v0[])
31545     {
31546         int j;
31547         double x, y, z, x0, y0, z0, r2, r, w, d;
31548 
31549 
31550         /* Star and tangent point. */
31551         x = v[0];
31552         y = v[1];
31553         z = v[2];
31554         x0 = v0[0];
31555         y0 = v0[1];
31556         z0 = v0[2];
31557 
31558         /* Deal with polar case. */
31559         r2 = x0*x0 + y0*y0;
31560         r = sqrt(r2);
31561         if ( r == 0.0 ) {
31562             r = 1e-20;
31563             x0 = r;
31564         }
31565 
31566         /* Reciprocal of star vector length to tangent plane. */
31567         w = x*x0 + y*y0;
31568         d = w + z*z0;
31569 
31570         /* Check for error cases. */
31571         if ( d > TANGENT_TINY ) {
31572             j = 0;
31573         } else if ( d >= 0.0 ) {
31574             j = 1;
31575             d = TANGENT_TINY;
31576         } else if ( d > -TANGENT_TINY ) {
31577             j = 2;
31578             d = -TANGENT_TINY;
31579         } else {
31580             j = 3;
31581         }
31582 
31583         /* Return the tangent plane coordinates (even in dubious cases). */
31584         d *= r;
31585         return new TangentPlaneCoordinate( (y*x0 - x*y0) / d,
31586                 (z*r2 - z0*w) / d, j);
31587 
31588 
31589         /* Finished. */
31590     }
31591 
31592     /**
31593      *  Convert B1950.0 FK4 star catalog data to J2000.0 FK5.
31594      *  This function converts a star's catalog data from the old FK4
31595      * (Bessel-Newcomb) system to the later IAU 1976 FK5 (Fricke) system.
31596      *  
31597      *  <p>This function is derived from the International Astronomical Union's
31598      *  SOFA (Standards of Fundamental Astronomy) software collection.
31599      *  
31600      *  Status:  support function.
31601      *  
31602      * 
31603      *  <!-- Given: --> (all B1950.0, FK4)
31604      *     @param r1950    double   B1950.0 RA (rad)
31605      *     @param d1950    double   B1950.0 Dec (rad)
31606      *     @param dr1950  double   B1950.0 proper motions (rad/trop.yr)
31607      *     @param dd1950  double   B1950.0 proper motions (rad/trop.yr)
31608      *     @param p1950          double   parallax (arcsec)
31609      *     @param v1950          double   radial velocity (km/s, +ve = moving away)
31610      *  Returned:
31611      *  
31612      *   @return  - catalogue coordinates (all J2000.0, FK5)
31613      *   
31614      * <p>Notes: <ol>
31615      * 
31616      * <li> The proper motions in RA are dRA/dt rather than cos(Dec)*dRA/dt,
31617      *     and are per year rather than per century.
31618      * <li> The conversion is somewhat complicated, for several reasons:
31619      *     . Change of standard epoch from B1950.0 to J2000.0.
31620      *     . An intermediate transition date of 1984 January 1.0 TT.
31621      *     . A change of precession model.
31622      *     . Change of time unit for proper motion (tropical to Julian).
31623      *     . FK4 positions include the E-terms of aberration, to simplify
31624      *       the hand computation of annual aberration.  FK5 positions
31625      *       assume a rigorous aberration computation based on the Earth's
31626      *       barycentric velocity.
31627      *     . The E-terms also affect proper motions, and in particular cause
31628      *       objects at large distances to exhibit fictitious proper
31629      *       motions.
31630      *     The algorithm is based on Smith et al. (1989) and Yallop et al.
31631      *     (1989), which presented a matrix method due to Standish (1982) as
31632      *     developed by Aoki et al. (1983), using Kinoshita's development of
31633      *     Andoyer's post-Newcomb precession.  The numerical constants from
31634      *     Seidelmann (1992) are used canonically.
31635      * <li> Conversion from B1950.0 FK4 to J2000.0 FK5 only is provided for.
31636      *     Conversions for different epochs and equinoxes would require
31637      *     additional treatment for precession, proper motion and E-terms.
31638      * <li> In the FK4 catalog the proper motions of stars within 10 degrees
31639      *     of the poles do not embody differential E-terms effects and
31640      *     should, strictly speaking, be handled in a different manner from
31641      *     stars outside these regions.  However, given the general lack of
31642      *     homogeneity of the star data available for routine astrometry,
31643      *     the difficulties of handling positions that may have been
31644      *     determined from astrometric fields spanning the polar and non-
31645      *     polar regions, the likelihood that the differential E-terms
31646      *     effect was not taken into account when allowing for proper motion
31647      *     in past astrometry, and the undesirability of a discontinuity in
31648      *     the algorithm, the decision has been made in this SOFA algorithm
31649      *     to include the effects of differential E-terms on the proper
31650      *     motions for all stars, whether polar or not.  At epoch J2000.0,
31651      *     and measuring "on the sky" rather than in terms of RA change, the
31652      *     errors resulting from this simplification are less than
31653      *     1 milliarcsecond in position and 1 milliarcsecond per century in
31654      *     proper motion.
31655      * </ol>
31656      *  Called:
31657      *     iauAnp       normalize angle into range 0 to 2pi
31658      *     iauPv2s      pv-vector to spherical coordinates
31659      *     iauPdp       scalar product of two p-vectors
31660      *     iauPvmpv     pv-vector minus pv_vector
31661      *     iauPvppv     pv-vector plus pv_vector
31662      *     iauS2pv      spherical coordinates to pv-vector
31663      *     iauSxp       multiply p-vector by scalar
31664      * <p> References: <ul>
31665      * <li> Aoki, S. et al., 1983, "Conversion matrix of epoch B1950.0
31666      *     FK4-based positions of stars to epoch J2000.0 positions in
31667      *     accordance with the new IAU resolutions".  Astron.Astrophys.
31668      *     128, 263-267.
31669      *  <li>Seidelmann, P.K. (ed), 1992, "Explanatory Supplement to the
31670      *     Astronomical Almanac", ISBN 0-935702-68-7.
31671      * <li>Smith, C.A. et al., 1989, "The transformation of astrometric
31672      *     catalog systems to the equinox J2000.0".  Astron.J. 97, 265.
31673      * <li>Standish, E.M., 1982, "Conversion of positions and proper motions
31674      *     from B1950.0 to the IAU system at J2000.0".  Astron.Astrophys.,
31675      *     115, 1, 20-22.
31676      * <li>Yallop, B.D. et al., 1989, "Transformation of mean star places
31677      *     from FK4 B1950.0 to FK5 J2000.0 using matrices in 6-space".
31678      *     Astron.J. 97, 274.
31679      *     </ul>
31680      *  @version   2018 December 5
31681      *  @since SOFA release 2019-07-22
31682      */
31683     public static CatalogCoords jauFk425(double r1950, double d1950,
31684             double dr1950, double dd1950,
31685             double p1950, double v1950
31686             )
31687     {
31688         /* Radians per year to arcsec per century */
31689         final double PMF = 100.0*DR2AS;
31690 
31691         /* Small number to avoid arithmetic problems */
31692         final double TINY = 1e-30;
31693 
31694         /* Miscellaneous */
31695         double r, d, ur, ud, px, rv, pxvf, w;
31696         int i, j, k, l;
31697 
31698         /* Pv-vectors */
31699         double r0[][], 
31700         pv1[][], pv2[][] = new double[2][3];
31701 
31702         /*
31703          * CANONICAL CONSTANTS (Seidelmann 1992)
31704          */
31705 
31706         /* Km per sec to AU per tropical century */
31707         /* = 86400 * 36524.2198782 / 149597870.7 */
31708         final double VF = 21.095;
31709 
31710         /* Constant pv-vector (cf. Seidelmann 3.591-2, vectors A and Adot) */
31711         final double a[][] = new double[][] {
31712             { -1.62557e-6, -0.31919e-6, -0.13843e-6 },
31713             { +1.245e-3,   -1.580e-3,   -0.659e-3   }
31714         };
31715 
31716         /* 3x2 matrix of pv-vectors (cf. Seidelmann 3.591-4, matrix M) */
31717         final double em[][][][] = new double [][][][] {
31718 
31719             { { { +0.9999256782,     -0.0111820611,     -0.0048579477     },
31720                 { +0.00000242395018, -0.00000002710663, -0.00000001177656 } },
31721 
31722                 { { +0.0111820610,     +0.9999374784,     -0.0000271765     },
31723                     { +0.00000002710663, +0.00000242397878, -0.00000000006587 } },
31724 
31725                 { { +0.0048579479,     -0.0000271474,     +0.9999881997,    },
31726                         { +0.00000001177656, -0.00000000006582, +0.00000242410173 } } },
31727 
31728             { { { -0.000551,         -0.238565,         +0.435739        },
31729                 { +0.99994704,       -0.01118251,       -0.00485767       } },
31730 
31731                             { { +0.238514,         -0.002667,         -0.008541        },
31732                     { +0.01118251,       +0.99995883,       -0.00002718       } },
31733 
31734                             { { -0.435623,         +0.012254,         +0.002117         },
31735                         { +0.00485767,       -0.00002714,       +1.00000956       } } }
31736 
31737         };
31738 
31739         /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
31740 
31741         /* The FK4 data (units radians and arcsec per tropical century). */
31742         r = r1950;
31743         d = d1950;
31744         ur = dr1950*PMF;
31745         ud = dd1950*PMF;
31746         px = p1950;
31747         rv = v1950;
31748 
31749         /* Express as a pv-vector. */
31750         pxvf = px*VF;
31751         w = rv*pxvf;
31752         r0 = jauS2pv(r, d, 1.0, ur, ud, w);
31753 
31754         /* Allow for E-terms (cf. Seidelmann 3.591-2). */
31755         pv1 = jauPvmpv(r0, a);
31756         pv2[0] = jauSxp(jauPdp(r0[0], a[0]), r0[0]);
31757         pv2[1] = jauSxp(jauPdp(r0[0], a[1]), r0[0]);
31758         pv1 = jauPvppv(pv1, pv2);
31759 
31760         /* Convert pv-vector to Fricke system (cf. Seidelmann 3.591-3). */
31761         for ( i = 0; i < 2; i++ ) {
31762             for ( j = 0; j < 3; j++ ) {
31763                 w = 0.0;
31764                 for ( k = 0; k < 2; k++ ) {
31765                     for ( l = 0; l < 3; l++ ) {
31766                         w += em[i][j][k][l] * pv1[k][l];
31767                     }
31768                 }
31769                 pv2[i][j] = w;
31770             }
31771         }
31772 
31773         /* Revert to catalog form. */
31774         SphericalPositionVelocity sv = jauPv2s(pv2);//, &r, &d, &w, &ur, &ud, &rd);
31775         if ( px > TINY ) {
31776             rv = sv.vel.r/pxvf;
31777             px = px/sv.pos.r;
31778         }
31779 
31780         /* Return the results. */
31781         return new CatalogCoords(jauAnp(sv.pos.theta), sv.pos.phi, sv.vel.theta/PMF, sv.vel.phi/PMF, px, rv);
31782 
31783     }  
31784 
31785 
31786     /**
31787      *  Convert a B1950.0 FK4 star position to J2000.0 FK5, assuming zero
31788      *  proper motion in the FK5 system.
31789      *  <p>This function is derived from the International Astronomical Union's
31790      *  SOFA (Standards of Fundamental Astronomy) software collection.
31791      *  Status:  support function.
31792      *  This function converts a star's catalog data from the old FK4
31793      *  (Bessel-Newcomb) system to the later IAU 1976 FK5 (Fricke) system,
31794      *  in such a way that the FK5 proper motion is zero.  Because such a
31795      *  star has, in general, a non-zero proper motion in the FK4 system,
31796      *  the routine requires the epoch at which the position in the FK4
31797      *  system was determined.
31798      *  
31799      *  <!-- Given: -->
31800      *     @param r1950    double   B1950.0 FK4 RA at epoch (rad)
31801      *     @param d1950    double   B1950.0 FK4 Dec at epoch (rad)
31802      *     @param bepoch         double   Besselian epoch (e.g. 1979.3)
31803      * <!-- Returned: -->
31804      *     @return  J2000.0 FK5 RA,Dec (rad)
31805      * <p>Notes: <ol>
31806 
31807      * <li> The epoch bepoch is strictly speaking Besselian, but if a
31808      *     Julian epoch is supplied the result will be affected only to a
31809      *     negligible extent.
31810      * <li> The method is from Appendix 2 of Aoki et al. (1983), but using
31811      *     the constants of Seidelmann (1992).  See the routine iauFk425
31812      *     for a general introduction to the FK4 to FK5 conversion.
31813      * <li> Conversion from equinox B1950.0 FK4 to equinox J2000.0 FK5 only
31814      *     is provided for.  Conversions for different starting and/or
31815      *     ending epochs would require additional treatment for precession,
31816      *     proper motion and E-terms.
31817      * <li> In the FK4 catalog the proper motions of stars within 10 degrees
31818      *     of the poles do not embody differential E-terms effects and
31819      *     should, strictly speaking, be handled in a different manner from
31820      *     stars outside these regions.  However, given the general lack of
31821      *     homogeneity of the star data available for routine astrometry,
31822      *     the difficulties of handling positions that may have been
31823      *     determined from astrometric fields spanning the polar and non-
31824      *     polar regions, the likelihood that the differential E-terms
31825      *     effect was not taken into account when allowing for proper motion
31826      *     in past astrometry, and the undesirability of a discontinuity in
31827      *     the algorithm, the decision has been made in this SOFA algorithm
31828      *     to include the effects of differential E-terms on the proper
31829      *     motions for all stars, whether polar or not.  At epoch J2000.0,
31830      *     and measuring "on the sky" rather than in terms of RA change, the
31831      *     errors resulting from this simplification are less than
31832      *     1 milliarcsecond in position and 1 milliarcsecond per century in
31833      *     proper motion.
31834      * </ol>
31835      * <p> References: <ul>
31836      * <li>Aoki, S. et al., 1983, "Conversion matrix of epoch B1950.0
31837      *     FK4-based positions of stars to epoch J2000.0 positions in
31838      *     accordance with the new IAU resolutions".  Astron.Astrophys.
31839      *     128, 263-267.
31840      * <li>Seidelmann, P.K. (ed), 1992, "Explanatory Supplement to the
31841      *     Astronomical Almanac", ISBN 0-935702-68-7.
31842      * </ul>
31843      *  Called:
31844      *     iauAnp       normalize angle into range 0 to 2pi
31845      *     iauC2s       p-vector to spherical
31846      *     iauEpb2jd    Besselian epoch to Julian date
31847      *     iauEpj       Julian date to Julian epoch
31848      *     iauPdp       scalar product of two p-vectors
31849      *     iauPmp       p-vector minus p-vector
31850      *     iauPpsp      p-vector plus scaled p-vector
31851      *     iauPvu       update a pv-vector
31852      *     iauS2c       spherical to p-vector
31853      *  @version   2018 December 5
31854      *  @since SOFA release 2019-07-22
31855      */
31856     public static SphericalCoordinate jauFk45z(double r1950, double d1950, double bepoch)
31857     {
31858         /* Radians per year to arcsec per century */
31859         final double PMF = 100.0*DR2AS;
31860 
31861         /* Position and position+velocity vectors */
31862         double r0[], p[], pv[][] = new double[2][3];
31863 
31864         /* Miscellaneous */
31865         double w;
31866         int i, j, k;
31867 
31868         /*
31869          * CANONICAL CONSTANTS (Seidelmann 1992)
31870          */
31871 
31872         /* Vectors A and Adot (Seidelmann 3.591-2) */
31873         final double a[]  = new double[]{ -1.62557e-6, -0.31919e-6, -0.13843e-6 };
31874         final double ad[] = new double[]{ +1.245e-3,   -1.580e-3,   -0.659e-3   };
31875 
31876         /* 3x2 matrix of p-vectors (cf. Seidelmann 3.591-4, matrix M) */
31877         final double em[][][] = new double[][][] {
31878             { { +0.9999256782, -0.0111820611, -0.0048579477 },
31879                 { +0.0111820610, +0.9999374784, -0.0000271765 },
31880                 { +0.0048579479, -0.0000271474, +0.9999881997 } },
31881             { { -0.000551,     -0.238565,     +0.435739     },
31882                     { +0.238514,     -0.002667,     -0.008541     },
31883                     { -0.435623,     +0.012254,     +0.002117     } }
31884         };
31885 
31886         /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
31887 
31888         /* Spherical coordinates to p-vector. */
31889         r0 = jauS2c(r1950, d1950);
31890 
31891         /* Adjust p-vector A to give zero proper motion in FK5. */
31892         w  = (bepoch - 1950) / PMF;
31893         p = jauPpsp(a, w, ad );
31894 
31895         /* Remove E-terms. */
31896         p = jauPpsp(p, -jauPdp(r0,p), r0);
31897         p = jauPmp(r0, p);
31898 
31899         /* Convert to Fricke system pv-vector (cf. Seidelmann 3.591-3). */
31900         for ( i = 0; i < 2; i++ ) {
31901             for ( j = 0; j < 3; j++ ) {
31902                 w = 0.0;
31903                 for ( k = 0; k < 3; k++ ) {
31904                     w += em[i][j][k] * p[k];
31905                 }
31906                 pv[i][j] = w;
31907             }
31908         }
31909 
31910         /* Allow for fictitious proper motion. */
31911         JulianDate jd = jauEpb2jd(bepoch);
31912         w = (jauEpj(jd.djm0,jd.djm1)-2000.0) / PMF;
31913         pv = jauPvu(w, pv);
31914 
31915         /* Revert to spherical coordinates. */
31916         SphericalCoordinate sc = jauC2s(pv[0]);
31917         sc.alpha = jauAnp(sc.alpha);
31918         return sc;
31919 
31920     }
31921 
31922 
31923     /**
31924      *  Convert J2000.0 FK5 star catalog data to B1950.0 FK4.
31925       *  <p>This function is derived from the International Astronomical Union's
31926      *  SOFA (Standards of Fundamental Astronomy) software collection.
31927      *  Status:  support function.
31928      *  <!--Given: (all J2000.0, FK5) -->
31929      *     @param r2000   double   J2000.0 RA (rad)
31930      *     @param d2000    double   J2000.0 Dec (rad)
31931      *     @param dr2000  double   J2000.0 proper motions (rad/Jul.yr)
31932      *     @param dd2000  double   J2000.0 proper motions (rad/Jul.yr)
31933      *     @param p2000          double   parallax (arcsec)
31934      *     @param v2000          double   radial velocity (km/s, +ve = moving away)
31935      *  
31936      *   @return (all B1950.0, FK4)
31937      * <p>Notes: <ol>
31938 
31939      * <li> The proper motions in RA are dRA/dt rather than cos(Dec)*dRA/dt,
31940      *     and are per year rather than per century.
31941      * <li> The conversion is somewhat complicated, for several reasons:
31942      *     . Change of standard epoch from J2000.0 to B1950.0.
31943      *     . An intermediate transition date of 1984 January 1.0 TT.
31944      *     . A change of precession model.
31945      *     . Change of time unit for proper motion (Julian to tropical).
31946      *     . FK4 positions include the E-terms of aberration, to simplify
31947      *       the hand computation of annual aberration.  FK5 positions
31948      *       assume a rigorous aberration computation based on the Earth's
31949      *       barycentric velocity.
31950      *     . The E-terms also affect proper motions, and in particular cause
31951      *       objects at large distances to exhibit fictitious proper
31952      *       motions.
31953      *     The algorithm is based on Smith et al. (1989) and Yallop et al.
31954      *     (1989), which presented a matrix method due to Standish (1982) as
31955      *     developed by Aoki et al. (1983), using Kinoshita's development of
31956      *     Andoyer's post-Newcomb precession.  The numerical constants from
31957      *     Seidelmann (1992) are used canonically.
31958      * <li> In the FK4 catalog the proper motions of stars within 10 degrees
31959      *     of the poles do not embody differential E-terms effects and
31960      *     should, strictly speaking, be handled in a different manner from
31961      *     stars outside these regions.  However, given the general lack of
31962      *     homogeneity of the star data available for routine astrometry,
31963      *     the difficulties of handling positions that may have been
31964      *     determined from astrometric fields spanning the polar and non-
31965      *     polar regions, the likelihood that the differential E-terms
31966      *     effect was not taken into account when allowing for proper motion
31967      *     in past astrometry, and the undesirability of a discontinuity in
31968      *     the algorithm, the decision has been made in this SOFA algorithm
31969      *     to include the effects of differential E-terms on the proper
31970      *     motions for all stars, whether polar or not.  At epoch J2000.0,
31971      *     and measuring "on the sky" rather than in terms of RA change, the
31972      *     errors resulting from this simplification are less than
31973      *     1 milliarcsecond in position and 1 milliarcsecond per century in
31974      *     proper motion.
31975      * </ol>
31976      *  Called:
31977      *     iauAnp       normalize angle into range 0 to 2pi
31978      *     iauPdp       scalar product of two p-vectors
31979      *     iauPm        modulus of p-vector
31980      *     iauPmp       p-vector minus p-vector
31981      *     iauPpp       p-vector pluus p-vector
31982      *     iauPv2s      pv-vector to spherical coordinates
31983      *     iauS2pv      spherical coordinates to pv-vector
31984      *     iauSxp       multiply p-vector by scalar
31985      * <p> References: <ul>
31986      * <li>Aoki, S. et al., 1983, "Conversion matrix of epoch B1950.0
31987      *     FK4-based positions of stars to epoch J2000.0 positions in
31988      *     accordance with the new IAU resolutions".  Astron.Astrophys.
31989      *     128, 263-267.
31990      * <li>Seidelmann, P.K. (ed), 1992, "Explanatory Supplement to the
31991      *     Astronomical Almanac", ISBN 0-935702-68-7.
31992      * <li>Smith, C.A. et al., 1989, "The transformation of astrometric
31993      *     catalog systems to the equinox J2000.0".  Astron.J. 97, 265.
31994      * <li>Standish, E.M., 1982, "Conversion of positions and proper motions
31995      *     from B1950.0 to the IAU system at J2000.0".  Astron.Astrophys.,
31996      *     115, 1, 20-22.
31997      * <li>Yallop, B.D. et al., 1989, "Transformation of mean star places
31998      *     from FK4 B1950.0 to FK5 J2000.0 using matrices in 6-space".
31999      *     Astron.J. 97, 274.
32000      *     </ul>
32001      *  @version   2018 December 5
32002      *  @since SOFA release 2019-07-22
32003      */
32004     public static CatalogCoords jauFk524(double r2000, double d2000,
32005             double dr2000, double dd2000,
32006             double p2000, double v2000)
32007     {
32008         /* Radians per year to arcsec per century */
32009         final double PMF = 100.0*DR2AS;
32010 
32011         /* Small number to avoid arithmetic problems */
32012         final double TINY = 1e-30;
32013 
32014         /* Miscellaneous */
32015         double r, d, ur, ud, px, rv, pxvf, w;
32016         int i, j, k, l;
32017 
32018         /* Vectors, p and pv */
32019         double r0[][], r1[][] = new double[2][3], p1[], p2[], pv[][] = new double[2][3];
32020 
32021         /*
32022          * CANONICAL CONSTANTS (Seidelmann 1992)
32023          */
32024 
32025         /* Km per sec to AU per tropical century */
32026         /* = 86400 * 36524.2198782 / 149597870.7 */
32027         final double VF = 21.095;
32028 
32029         /* Constant pv-vector (cf. Seidelmann 3.591-2, vectors A and Adot) */
32030         final double a[][] = new double[][] {
32031             { -1.62557e-6, -0.31919e-6, -0.13843e-6 },
32032             { +1.245e-3,   -1.580e-3,   -0.659e-3   }
32033         };
32034 
32035         /* 3x2 matrix of pv-vectors (cf. Seidelmann 3.592-1, matrix M^-1) */
32036         final double em[][][][] = new double[][][][] {
32037 
32038             { { { +0.9999256795,     +0.0111814828,     +0.0048590039,    },
32039                 { -0.00000242389840, -0.00000002710544, -0.00000001177742 } },
32040 
32041                 { { -0.0111814828,     +0.9999374849,     -0.0000271771,    },
32042                     { +0.00000002710544, -0.00000242392702, +0.00000000006585 } },
32043 
32044                 { { -0.0048590040,     -0.0000271557,     +0.9999881946,    },
32045                         { +0.00000001177742, +0.00000000006585, -0.00000242404995 } } },
32046 
32047             { { { -0.000551,         +0.238509,         -0.435614,        },
32048                 { +0.99990432,       +0.01118145,       +0.00485852       } },
32049 
32050                             { { -0.238560,         -0.002667,         +0.012254,        },
32051                     { -0.01118145,       +0.99991613,       -0.00002717       } },
32052 
32053                             { { +0.435730,         -0.008541,         +0.002117,        },
32054                         { -0.00485852,       -0.00002716,       +0.99996684       } } }
32055 
32056         };
32057 
32058         /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
32059 
32060         /* The FK5 data (units radians and arcsec per Julian century). */
32061         r = r2000;
32062         d = d2000;
32063         ur = dr2000*PMF;
32064         ud = dd2000*PMF;
32065         px = p2000;
32066         rv = v2000;
32067 
32068         /* Express as a pv-vector. */
32069         pxvf = px * VF;
32070         w = rv * pxvf;
32071         r0 = jauS2pv(r, d, 1.0, ur, ud, w);
32072 
32073         /* Convert pv-vector to Bessel-Newcomb system (cf. Seidelmann 3.592-1). */
32074         for ( i = 0; i < 2; i++ ) {
32075             for ( j = 0; j < 3; j++ ) {
32076                 w = 0.0;
32077                 for ( k = 0; k < 2; k++ ) {
32078                     for ( l = 0; l < 3; l++ ) {
32079                         w += em[i][j][k][l] * r0[k][l];
32080                     }
32081                 }
32082                 r1[i][j] = w;
32083             }
32084         }
32085 
32086         /* Apply E-terms (equivalent to Seidelmann 3.592-3, one iteration). */
32087 
32088         /* Direction. */
32089         w = jauPm(r1[0]);
32090         p1 =jauSxp(jauPdp(r1[0],a[0]), r1[0]);
32091         p2 = jauSxp(w, a[0]);
32092         p1 = jauPmp(p2, p1);
32093         p1 = jauPpp(r1[0], p1);
32094 
32095         /* Recompute length. */
32096         w = jauPm(p1);
32097 
32098         /* Direction. */
32099         p1 = jauSxp(jauPdp(r1[0],a[0]), r1[0]);
32100         p2 = jauSxp(w, a[0]);
32101         p1 = jauPmp(p2, p1);
32102         pv[0] = jauPpp(r1[0], p1);
32103 
32104         /* Derivative. */
32105         p1 =jauSxp(jauPdp(r1[0],a[1]), pv[0]);
32106         p2 = jauSxp(w, a[1]);
32107         p1 = jauPmp(p2, p1);
32108         pv[1] = jauPpp(r1[1], p1);
32109 
32110         /* Revert to catalog form. */
32111         SphericalPositionVelocity sv = jauPv2s(pv);//, &r, &d, &w, &ur, &ud, &rd);
32112         if ( px > TINY ) {
32113             rv = sv.vel.r/pxvf;
32114             px = px/sv.pos.r;
32115         }
32116 
32117         /* Return the results. */
32118         return new CatalogCoords(jauAnp(sv.pos.theta), sv.pos.phi, sv.vel.theta/PMF, sv.vel.phi/PMF, px, rv);
32119     }
32120 
32121     /**
32122      *  Convert a J2000.0 FK5 star position to B1950.0 FK4, assuming zero
32123      *  proper motion in FK5 and parallax.
32124      *  <p>This function is derived from the International Astronomical Union's
32125      *  SOFA (Standards of Fundamental Astronomy) software collection.
32126      *  Status:  support function.
32127      *     @param r2000    double   J2000.0 FK5 RA (rad)
32128      *     @param d2000    double   J2000.0 FK5 Dec (rad)
32129      *     @param bepoch         double   Besselian epoch (e.g. 1950.0)
32130      *     @return    B1950.0 FK4 RA,Dec (rad) at epoch BEPOCH
32131      * 
32132      * <p>Notes: <ol>
32133 
32134      * <li> In contrast to the iauFk524  routine, here the FK5 proper
32135      *     motions, the parallax and the radial velocity are presumed zero.
32136      * <li> This function converts a star position from the IAU 1976 FK5
32137      *    (Fricke) system to the former FK4 (Bessel-Newcomb) system, for
32138      *     cases such as distant radio sources where it is presumed there is
32139      *     zero parallax and no proper motion.  Because of the E-terms of
32140      *     aberration, such objects have (in general) non-zero proper motion
32141      *     in FK4, and the present routine returns those fictitious proper
32142      *     motions.
32143      * <li> Conversion from J2000.0 FK5 to B1950.0 FK4 only is provided for.
32144      *     Conversions involving other equinoxes would require additional
32145      *     treatment for precession.
32146      * <li> The position returned by this routine is in the B1950.0 FK4
32147      *     reference system but at Besselian epoch BEPOCH.  For comparison
32148      *     with catalogs the BEPOCH argument will frequently be 1950.0. (In
32149      *     this context the distinction between Besselian and Julian epoch
32150      *     is insignificant.)
32151      * <li> The RA component of the returned (fictitious) proper motion is
32152      *     dRA/dt rather than cos(Dec)*dRA/dt.
32153      * </ol>
32154      *  Called:
32155      *     jauAnp       normalize angle into range 0 to 2pi
32156      *     jauC2s       p-vector to spherical
32157      *     jauFk524     FK4 to FK5
32158      *     jauS2c       spherical to p-vector
32159      *  @version   2018 December 5
32160      *  @since SOFA release 2019-07-22
32161      */
32162     public static CatalogCoords jauFk54z(double r2000, double d2000, double bepoch)
32163     {
32164         double  p[], w, v[]= new double[3];
32165         int i;
32166 
32167 
32168         /* FK5 equinox J2000.0 to FK4 equinox B1950.0. */
32169         CatalogCoords cc = jauFk524(r2000, d2000, 0.0, 0.0, 0.0, 0.0);
32170 
32171         /* Spherical to Cartesian. */
32172         p = jauS2c(cc.pos.alpha, cc.pos.delta );
32173 
32174         /* Fictitious proper motion (radians per year). */
32175         v[0] = - cc.pm.alpha*p[1] - cc.pm.delta*cos(cc.pos.alpha)*sin(cc.pos.delta);
32176         v[1] =   cc.pm.alpha*p[0] - cc.pm.delta*sin(cc.pos.alpha)*sin(cc.pos.delta);
32177         v[2] =             cc.pm.delta*cos(cc.pos.delta);
32178 
32179         /* Apply the motion. */
32180         w = bepoch - 1950.0;
32181         for ( i = 0; i < 3; i++ ) {
32182             p[i] += w*v[i];
32183         }
32184 
32185         /* Cartesian to spherical. */
32186         SphericalCoordinate sp = jauC2s(p);
32187         cc.pos.alpha = jauAnp(sp.alpha);
32188         cc.pos.delta = sp.delta;
32189 
32190         return cc;
32191 
32192     }
32193 
32194 /*
32195 * Coefficients for Moon longitude and distance series
32196 */
32197    private static class Termlr {
32198       int nd;           /* multiple of D  in argument           */
32199       int nem;          /*     "    "  M   "    "               */
32200       int nemp;         /*     "    "  M'  "    "               */
32201       int nf;           /*     "    "  F   "    "               */
32202       double coefl;     /* coefficient of L sine argument (deg) */
32203       double coefr;     /* coefficient of R cosine argument (m) */
32204     public Termlr(int nd, int nem, int nemp, int nf, double coefl,
32205             double coefr) {
32206         this.nd = nd;
32207         this.nem = nem;
32208         this.nemp = nemp;
32209         this.nf = nf;
32210         this.coefl = coefl;
32211         this.coefr = coefr;
32212     }
32213    };
32214 
32215 /*
32216 * Coefficients for Moon latitude series
32217 */
32218    private static class Termb {
32219       int nd;           /* multiple of D  in argument           */
32220       int nem;          /*     "    "  M   "    "               */
32221       int nemp;         /*     "    "  M'  "    "               */
32222       int nf;           /*     "    "  F   "    "               */
32223       double coefb;     /* coefficient of B sine argument (deg) */
32224     public Termb(int nd, int nem, int nemp, int nf, double coefb) {
32225         this.nd = nd;
32226         this.nem = nem;
32227         this.nemp = nemp;
32228         this.nf = nf;
32229         this.coefb = coefb;
32230     }
32231    };
32232 
32233 
32234    /**
32235     *
32236     *  Approximate geocentric position and velocity of the Moon.
32237     *
32238     *  This function is part of the International Astronomical Union's
32239     *  SOFA (Standards Of Fundamental Astronomy) software collection.
32240     *
32241     *  <p>Status:  support function.
32242     *
32243     *  <p>n.b. Not IAU-endorsed and without canonical status.
32244     *
32245     *  <!-- Given: -->
32246     *  @param   date1  double         TT date part A (Notes 1,4)
32247     *  @param   date2  double         TT date part B (Notes 1,4)
32248     *
32249     *  <!-- Returned: -->
32250     *  @return   pv     double[2][3]   Moon p,v, GCRS (AU, AU/d, Note 5)
32251     *
32252     *  <p>Notes:
32253     *  <ol>
32254     *  <li>The TT date date1+date2 is a Julian Date, apportioned in any
32255     *     convenient way between the two arguments.  For example,
32256     *     JD(TT)=2450123.7 could be expressed in any of these ways, among
32257     *     others:
32258     *
32259     *            date1          date2
32260     *
32261     *         2450123.7           0.0       (JD method)
32262     *         2451545.0       -1421.3       (J2000 method)
32263     *         2400000.5       50123.2       (MJD method)
32264     *         2450123.5           0.2       (date &amp; time method)
32265     *
32266     *     The JD method is the most natural and convenient to use in cases
32267     *     where the loss of several decimal digits of resolution is
32268     *     acceptable.  The J2000 method is best matched to the way the
32269     *     argument is handled internally and will deliver the optimum
32270     *     resolution.  The MJD method and the date &amp; time methods are both
32271     *     good compromises between resolution and convenience.  The limited
32272     *     accuracy of the present algorithm is such that any of the methods
32273     *     is satisfactory.
32274     *
32275     *  <li> This function is a full implementation of the algorithm
32276     *     published by Meeus (see reference) except that the light-time
32277     *     correction to the Moon's mean longitude has been omitted.
32278     *
32279     *  <li> Comparisons with ELP/MPP02 over the interval 1950-2100 gave RMS
32280     *     errors of 2.9 arcsec in geocentric direction, 6.1 km in position
32281     *     and 36 mm/s in velocity.  The worst case errors were 18.3 arcsec
32282     *     in geocentric direction, 31.7 km in position and 172 mm/s in
32283     *     velocity.
32284     *
32285     *  <li> The original algorithm is expressed in terms of "dynamical time",
32286     *     which can either be TDB or TT without any significant change in
32287     *     accuracy.  UT cannot be used without incurring significant errors
32288     *     (30 arcsec in the present era) due to the Moon's 0.5 arcsec/sec
32289     *     movement.
32290     *
32291     *  <li> The result is with respect to the GCRS (the same as J2000.0 mean
32292     *     equator and equinox to within 23 mas).
32293     *
32294     *  <li> Velocity is obtained by a complete analytical differentiation
32295     *     of the Meeus model.
32296     *
32297     *  <li> The Meeus algorithm generates position and velocity in mean
32298     *     ecliptic coordinates of date, which the present function then
32299     *     rotates into GCRS.  Because the ecliptic system is precessing,
32300     *     there is a coupling between this spin (about 1.4 degrees per
32301     *     century) and the Moon position that produces a small velocity
32302     *     contribution.  In the present function this effect is neglected
32303     *     as it corresponds to a maximum difference of less than 3 mm/s and
32304     *     increases the RMS error by only 0.4%.
32305     *  </ol>
32306     *  <p>References:
32307     *  <ul>
32308     *  <li>   Meeus, J., Astronomical Algorithms, 2nd edition, Willmann-Bell,
32309     *     1998, p337.
32310     *
32311     *  <li>   Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
32312     *     Francou, G. &amp; Laskar, J., Astron.Astrophys., 1994, 282, 663
32313     *  </ul>
32314     *  Defined in sofam.h:
32315     *     DAU           astronomical unit (m)
32316     *     DJC           days per Julian century
32317     *     DJ00          reference epoch (J2000.0), Julian Date
32318     *     DD2R          degrees to radians
32319     *
32320     *  Called:
32321     *     iauS2pv      spherical coordinates to pv-vector
32322     *     iauPfw06     bias-precession F-W angles, IAU 2006
32323     *     iauIr        initialize r-matrix to identity
32324     *     iauRz        rotate around Z-axis
32325     *     iauRx        rotate around X-axis
32326     *     iauRxpv      product of r-matrix and pv-vector
32327     *
32328     *  @version  2021 May 11
32329     *
32330     *  @since SOFA release 2021-05-12
32331     *
32332     *  <!-- Copyright (C) 2021 IAU SOFA Board.  See notes at end. -->
32333     */
32334    public static double[][] jauMoon98 ( double date1, double date2 )
32335    {
32336        /*
32337         **  Coefficients for fundamental arguments:
32338         **
32339         **  . Powers of time in Julian centuries
32340         **  . Units are degrees.
32341         */
32342 
32343        /* Moon's mean longitude (wrt mean equinox and ecliptic of date) */
32344        final double elp0 = 218.31665436,        /* Simon et al. (1994). */
32345                elp1 = 481267.88123421,
32346                elp2 = -0.0015786,
32347                elp3 = 1.0 / 538841.0,
32348                elp4 = -1.0 / 65194000.0;
32349        double elp, delp;
32350 
32351        /* Moon's mean elongation */
32352        final double d0 = 297.8501921,
32353                d1 = 445267.1114034,
32354                d2 = -0.0018819,
32355                d3 = 1.0 / 545868.0,
32356                d4 = 1.0 / 113065000.0;
32357        double d, dd;
32358 
32359        /* Sun's mean anomaly */
32360        final double em0 = 357.5291092,
32361                em1 = 35999.0502909,
32362                em2 = -0.0001536,
32363                em3 = 1.0 / 24490000.0,
32364                em4 = 0.0;
32365        double em, dem;
32366 
32367        /* Moon's mean anomaly */
32368        final double emp0 = 134.9633964,
32369                emp1 = 477198.8675055,
32370                emp2 = 0.0087414,
32371                emp3 = 1.0 / 69699.0,
32372                emp4 = -1.0 / 14712000.0;
32373        double emp, demp;
32374 
32375        /* Mean distance of the Moon from its ascending node */
32376        final double f0 = 93.2720950,
32377                f1 = 483202.0175233,
32378                f2 = -0.0036539,
32379                f3 = 1.0 / 3526000.0,
32380                f4 = 1.0 / 863310000.0;
32381        double f, df;
32382 
32383        /*
32384         ** Other arguments
32385         */
32386 
32387        /* Meeus A_1, due to Venus (deg) */
32388        final double a10 = 119.75,
32389                a11 = 131.849;
32390        double a1, da1;
32391 
32392        /* Meeus A_2, due to Jupiter (deg) */
32393        final double a20 = 53.09,
32394                a21 = 479264.290;
32395        double a2, da2;
32396 
32397        /* Meeus A_3, due to sidereal motion of the Moon in longitude (deg) */
32398        final double a30 = 313.45,
32399                a31 = 481266.484;
32400        double a3, da3;
32401 
32402        /* Coefficients for Meeus "additive terms" (deg) */
32403        final double al1 =  0.003958,
32404                al2 =  0.001962,
32405                al3 =  0.000318;
32406        final double ab1 = -0.002235,
32407                ab2 =  0.000382,
32408                ab3 =  0.000175,
32409                ab4 =  0.000175,
32410                ab5 =  0.000127,
32411                ab6 = -0.000115;
32412 
32413        /* Fixed term in distance (m) */
32414        final double r0 = 385000560.0;
32415 
32416        /* Coefficients for (dimensionless) E factor */
32417        final double e1 = -0.002516,
32418                e2 = -0.0000074;
32419        double e, de, esq, desq;
32420 
32421 
32422        final Termlr tlr[] = {     new Termlr(0,  0,  1,  0,  6.288774, -20905355.0),
32423                new Termlr(2,  0, -1,  0,  1.274027,  -3699111.0),
32424                new Termlr(2,  0,  0,  0,  0.658314,  -2955968.0),
32425                new Termlr(0,  0,  2,  0,  0.213618,   -569925.0),
32426                new Termlr(0,  1,  0,  0, -0.185116,     48888.0),
32427                new Termlr(0,  0,  0,  2, -0.114332,     -3149.0),
32428                new Termlr(2,  0, -2,  0,  0.058793,    246158.0),
32429                new Termlr(2, -1, -1,  0,  0.057066,   -152138.0),
32430                new Termlr(2,  0,  1,  0,  0.053322,   -170733.0),
32431                new Termlr(2, -1,  0,  0,  0.045758,   -204586.0),
32432                new Termlr(0,  1, -1,  0, -0.040923,   -129620.0),
32433                new Termlr(1,  0,  0,  0, -0.034720,    108743.0),
32434                new Termlr(0,  1,  1,  0, -0.030383,    104755.0),
32435                new Termlr(2,  0,  0, -2,  0.015327,     10321.0),
32436                new Termlr(0,  0,  1,  2, -0.012528,         0.0),
32437                new Termlr(0,  0,  1, -2,  0.010980,     79661.0),
32438                new Termlr(4,  0, -1,  0,  0.010675,    -34782.0),
32439                new Termlr(0,  0,  3,  0,  0.010034,    -23210.0),
32440                new Termlr(4,  0, -2,  0,  0.008548,    -21636.0),
32441                new Termlr(2,  1, -1,  0, -0.007888,     24208.0),
32442                new Termlr(2,  1,  0,  0, -0.006766,     30824.0),
32443                new Termlr(1,  0, -1,  0, -0.005163,     -8379.0),
32444                new Termlr(1,  1,  0,  0,  0.004987,    -16675.0),
32445                new Termlr(2, -1,  1,  0,  0.004036,    -12831.0),
32446                new Termlr(2,  0,  2,  0,  0.003994,    -10445.0),
32447                new Termlr(4,  0,  0,  0,  0.003861,    -11650.0),
32448                new Termlr(2,  0, -3,  0,  0.003665,     14403.0),
32449                new Termlr(0,  1, -2,  0, -0.002689,     -7003.0),
32450                new Termlr(2,  0, -1,  2, -0.002602,         0.0),
32451                new Termlr(2, -1, -2,  0,  0.002390,     10056.0),
32452                new Termlr(1,  0,  1,  0, -0.002348,      6322.0),
32453                new Termlr(2, -2,  0,  0,  0.002236,     -9884.0),
32454                new Termlr(0,  1,  2,  0, -0.002120,      5751.0),
32455                new Termlr(0,  2,  0,  0, -0.002069,         0.0),
32456                new Termlr(2, -2, -1,  0,  0.002048,     -4950.0),
32457                new Termlr(2,  0,  1, -2, -0.001773,      4130.0),
32458                new Termlr(2,  0,  0,  2, -0.001595,         0.0),
32459                new Termlr(4, -1, -1,  0,  0.001215,     -3958.0),
32460                new Termlr(0,  0,  2,  2, -0.001110,         0.0),
32461                new Termlr(3,  0, -1,  0, -0.000892,      3258.0),
32462                new Termlr(2,  1,  1,  0, -0.000810,      2616.0),
32463                new Termlr(4, -1, -2,  0,  0.000759,     -1897.0),
32464                new Termlr(0,  2, -1,  0, -0.000713,     -2117.0),
32465                new Termlr(2,  2, -1,  0, -0.000700,      2354.0),
32466                new Termlr(2,  1, -2,  0,  0.000691,         0.0),
32467                new Termlr(2, -1,  0, -2,  0.000596,         0.0),
32468                new Termlr(4,  0,  1,  0,  0.000549,     -1423.0),
32469                new Termlr(0,  0,  4,  0,  0.000537,     -1117.0),
32470                new Termlr(4, -1,  0,  0,  0.000520,     -1571.0),
32471                new Termlr(1,  0, -2,  0, -0.000487,     -1739.0),
32472                new Termlr(2,  1,  0, -2, -0.000399,         0.0),
32473                new Termlr(0,  0,  2, -2, -0.000381,     -4421.0),
32474                new Termlr(1,  1,  1,  0,  0.000351,         0.0),
32475                new Termlr(3,  0, -2,  0, -0.000340,         0.0),
32476                new Termlr(4,  0, -3,  0,  0.000330,         0.0),
32477                new Termlr(2, -1,  2,  0,  0.000327,         0.0),
32478                new Termlr(0,  2,  1,  0, -0.000323,      1165.0),
32479                new Termlr(1,  1, -1,  0,  0.000299,         0.0),
32480                new Termlr(2,  0,  3,  0,  0.000294,         0.0),
32481                new Termlr(2,  0, -1, -2,  0.000000,      8752.0)};
32482 
32483        final int NLR = tlr.length;
32484 
32485 
32486 
32487        final  Termb tb[] = {    new Termb(0,  0,  0,  1,  5.128122),
32488                new Termb(0,  0,  1,  1,  0.280602),
32489                new Termb(0,  0,  1, -1,  0.277693),
32490                new Termb(2,  0,  0, -1,  0.173237),
32491                new Termb(2,  0, -1,  1,  0.055413),
32492                new Termb(2,  0, -1, -1,  0.046271),
32493                new Termb(2,  0,  0,  1,  0.032573),
32494                new Termb(0,  0,  2,  1,  0.017198),
32495                new Termb(2,  0,  1, -1,  0.009266),
32496                new Termb(0,  0,  2, -1,  0.008822),
32497                new Termb(2, -1,  0, -1,  0.008216),
32498                new Termb(2,  0, -2, -1,  0.004324),
32499                new Termb(2,  0,  1,  1,  0.004200),
32500                new Termb(2,  1,  0, -1, -0.003359),
32501                new Termb(2, -1, -1,  1,  0.002463),
32502                new Termb(2, -1,  0,  1,  0.002211),
32503                new Termb(2, -1, -1, -1,  0.002065),
32504                new Termb(0,  1, -1, -1, -0.001870),
32505                new Termb(4,  0, -1, -1,  0.001828),
32506                new Termb(0,  1,  0,  1, -0.001794),
32507                new Termb(0,  0,  0,  3, -0.001749),
32508                new Termb(0,  1, -1,  1, -0.001565),
32509                new Termb(1,  0,  0,  1, -0.001491),
32510                new Termb(0,  1,  1,  1, -0.001475),
32511                new Termb(0,  1,  1, -1, -0.001410),
32512                new Termb(0,  1,  0, -1, -0.001344),
32513                new Termb(1,  0,  0, -1, -0.001335),
32514                new Termb(0,  0,  3,  1,  0.001107),
32515                new Termb(4,  0,  0, -1,  0.001021),
32516                new Termb(4,  0, -1,  1,  0.000833),
32517                new Termb(0,  0,  1, -3,  0.000777),
32518                new Termb(4,  0, -2,  1,  0.000671),
32519                new Termb(2,  0,  0, -3,  0.000607),
32520                new Termb(2,  0,  2, -1,  0.000596),
32521                new Termb(2, -1,  1, -1,  0.000491),
32522                new Termb(2,  0, -2,  1, -0.000451),
32523                new Termb(0,  0,  3, -1,  0.000439),
32524                new Termb(2,  0,  2,  1,  0.000422),
32525                new Termb(2,  0, -3, -1,  0.000421),
32526                new Termb(2,  1, -1,  1, -0.000366),
32527                new Termb(2,  1,  0,  1, -0.000351),
32528                new Termb(4,  0,  0,  1,  0.000331),
32529                new Termb(2, -1,  1,  1,  0.000315),
32530                new Termb(2, -2,  0, -1,  0.000302),
32531                new Termb(0,  0,  1,  3, -0.000283),
32532                new Termb(2,  1,  1, -1, -0.000229),
32533                new Termb(1,  1,  0, -1,  0.000223),
32534                new Termb(1,  1,  0,  1,  0.000223),
32535                new Termb(0,  1, -2, -1, -0.000220),
32536                new Termb(2,  1, -1, -1, -0.000220),
32537                new Termb(1,  0,  1,  1, -0.000185),
32538                new Termb(2, -1, -2, -1,  0.000181),
32539                new Termb(0,  1,  2,  1, -0.000177),
32540                new Termb(4,  0, -2, -1,  0.000176),
32541                new Termb(4, -1, -1, -1,  0.000166),
32542                new Termb(1,  0,  1, -1, -0.000164),
32543                new Termb(4,  0,  1, -1,  0.000132),
32544                new Termb(1,  0, -1, -1, -0.000119),
32545                new Termb(4, -1,  0, -1,  0.000115),
32546                new Termb(2, -2,  0,  1,  0.000107)};
32547 
32548        final int NB = tb.length;
32549 
32550        /* Miscellaneous */
32551        int n, i;
32552        double t, elpmf, delpmf, vel, vdel, vr, vdr, a1mf, da1mf, a1pf,
32553        da1pf, dlpmp, slpmp, vb, vdb, v, dv, emn, empn, dn, fn, en,
32554        den, arg, darg, farg, coeff, el, del, r, dr, b, db, rm[][]= new double[3][3];
32555 
32556        /* ------------------------------------------------------------------ */
32557 
32558        /* Centuries since J2000.0 */
32559        t = ((date1 - DJ00) + date2) / DJC;
32560 
32561        /* --------------------- */
32562        /* Fundamental arguments */
32563        /* --------------------- */
32564 
32565        /* Arguments (radians) and derivatives (radians per Julian century)
32566    for the current date. */
32567 
32568        /* Moon's mean longitude. */
32569        elp = DD2R * fmod ( elp0
32570                + ( elp1
32571                        + ( elp2
32572                                + ( elp3
32573                                        +   elp4 * t ) * t ) * t ) * t, 360.0 );
32574        delp = DD2R * (     elp1
32575                + ( elp2 * 2.0
32576                        + ( elp3 * 3.0
32577                                +   elp4 * 4.0 * t ) * t ) * t );
32578 
32579        /* Moon's mean elongation. */
32580        d = DD2R * fmod ( d0
32581                + ( d1
32582                        + ( d2
32583                                + ( d3
32584                                        +   d4 * t ) * t ) * t ) * t, 360.0 );
32585        dd = DD2R * (     d1
32586                + ( d2 * 2.0
32587                        + ( d3 * 3.0
32588                                +   d4 * 4.0 * t ) * t ) * t );
32589 
32590        /* Sun's mean anomaly. */
32591        em = DD2R * fmod ( em0
32592                + ( em1
32593                        + ( em2
32594                                + ( em3
32595                                        +   em4 * t ) * t ) * t ) * t, 360.0 );
32596        dem = DD2R * (     em1
32597                + ( em2 * 2.0
32598                        + ( em3 * 3.0
32599                                +   em4 * 4.0 * t ) * t ) * t );
32600 
32601        /* Moon's mean anomaly. */
32602        emp = DD2R * fmod ( emp0
32603                + ( emp1
32604                        + ( emp2
32605                                + ( emp3
32606                                        +   emp4 * t ) * t ) * t ) * t, 360.0 );
32607        demp = DD2R * (     emp1
32608                + ( emp2 * 2.0
32609                        + ( emp3 * 3.0
32610                                +   emp4 * 4.0 * t ) * t ) * t );
32611 
32612        /* Mean distance of the Moon from its ascending node. */
32613        f = DD2R * fmod ( f0
32614                + ( f1
32615                        + ( f2
32616                                + ( f3
32617                                        +   f4 * t ) * t ) * t ) * t, 360.0 );
32618        df = DD2R * (     f1
32619                + ( f2 * 2.0
32620                        + ( f3 * 3.0
32621                                +   f4 * 4.0 * t ) * t ) * t );
32622 
32623        /* Meeus further arguments. */
32624        a1 = DD2R * ( a10 + a11*t );
32625        da1 = DD2R * al1;
32626        a2 = DD2R * ( a20 + a21*t );
32627        da2 = DD2R * a21;
32628        a3 = DD2R * ( a30 + a31*t );
32629        da3 = DD2R * a31;
32630 
32631        /* E-factor, and square. */
32632        e = 1.0 + ( e1 + e2*t ) * t;
32633        de = e1 + 2.0*e2*t;
32634        esq = e*e;
32635        desq = 2.0*e*de;
32636 
32637        /* Use the Meeus additive terms (deg) to start off the summations. */
32638        elpmf = elp - f;
32639        delpmf = delp - df;
32640        vel = al1 * sin(a1)
32641                + al2 * sin(elpmf)
32642                + al3 * sin(a2);
32643        vdel = al1 * cos(a1) * da1
32644                + al2 * cos(elpmf) * delpmf
32645                + al3 * cos(a2) * da2;
32646 
32647        vr = 0.0;
32648        vdr = 0.0;
32649 
32650        a1mf = a1 - f;
32651        da1mf = da1 - df;
32652        a1pf = a1 + f;
32653        da1pf = da1 + df;
32654        dlpmp = elp - emp;
32655        slpmp = elp + emp;
32656        vb = ab1 * sin(elp)
32657                + ab2 * sin(a3)
32658                + ab3 * sin(a1mf)
32659                + ab4 * sin(a1pf)
32660                + ab5 * sin(dlpmp)
32661                + ab6 * sin(slpmp);
32662        vdb = ab1 * cos(elp) * delp
32663                + ab2 * cos(a3) * da3
32664                + ab3 * cos(a1mf) * da1mf
32665                + ab4 * cos(a1pf) * da1pf
32666                + ab5 * cos(dlpmp) * (delp-demp)
32667                + ab6 * cos(slpmp) * (delp+demp);
32668 
32669        /* ----------------- */
32670        /* Series expansions */
32671        /* ----------------- */
32672 
32673        /* Longitude and distance plus derivatives. */
32674        for ( n = NLR-1; n >= 0; n-- ) {
32675            dn = (double) tlr[n].nd;
32676            emn = (double) ( i = tlr[n].nem );
32677            empn = (double) tlr[n].nemp;
32678            fn = (double) tlr[n].nf;
32679            switch ( abs(i) ) {
32680            case 1:
32681                en = e;
32682                den = de;
32683                break;
32684            case 2:
32685                en = esq;
32686                den = desq;
32687                break;
32688            default:
32689                en = 1.0;
32690                den = 0.0;
32691            }
32692            arg = dn*d + emn*em + empn*emp + fn*f;
32693            darg = dn*dd + emn*dem + empn*demp + fn*df;
32694            farg = sin(arg);
32695            v = farg * en;
32696            dv = cos(arg)*darg*en + farg*den;
32697            coeff = tlr[n].coefl;
32698            vel += coeff * v;
32699            vdel += coeff * dv;
32700            farg = cos(arg);
32701            v = farg * en;
32702            dv = -sin(arg)*darg*en + farg*den;
32703            coeff = tlr[n].coefr;
32704            vr += coeff * v;
32705            vdr += coeff * dv;
32706        }
32707        el = elp + DD2R*vel;
32708        del = ( delp + DD2R*vdel ) / DJC;
32709        r = ( vr + r0 ) / DAU;
32710        dr = vdr / DAU / DJC;
32711 
32712        /* Latitude plus derivative. */
32713        for ( n = NB-1; n >= 0; n-- ) {
32714            dn = (double) tb[n].nd;
32715            emn = (double) ( i = tb[n].nem );
32716            empn = (double) tb[n].nemp;
32717            fn = (double) tb[n].nf;
32718            switch ( abs(i) ) {
32719            case 1:
32720                en = e;
32721                den = de;
32722                break;
32723            case 2:
32724                en = esq;
32725                den = desq;
32726                break;
32727            default:
32728                en = 1.0;
32729                den = 0.0;
32730            }
32731            arg = dn*d + emn*em + empn*emp + fn*f;
32732            darg = dn*dd + emn*dem + empn*demp + fn*df;
32733            farg = sin(arg);
32734            v = farg * en;
32735            dv = cos(arg)*darg*en + farg*den;
32736            coeff = tb[n].coefb;
32737            vb += coeff * v;
32738            vdb += coeff * dv;
32739        }
32740        b = vb * DD2R;
32741        db = vdb * DD2R / DJC;
32742 
32743        /* ------------------------------ */
32744        /* Transformation into final form */
32745        /* ------------------------------ */
32746 
32747        /* Longitude, latitude to x, y, z (AU). */
32748        double[][] pv = jauS2pv ( el, b, r, del, db, dr );
32749 
32750        /* IAU 2006 Fukushima-Williams bias+precession angles. */
32751        FWPrecessionAngles fw = jauPfw06 ( date1, date2 );  
32752 
32753        /* Mean ecliptic coordinates to GCRS rotation matrix. */
32754        jauIr ( rm );
32755        jauRz ( fw.psib, rm );
32756        jauRx ( -fw.phib, rm );
32757        jauRz ( -fw.gamb, rm );
32758 
32759        /* Rotate the Moon position and velocity into GCRS (Note 6). */
32760        return jauRxpv ( rm, pv);
32761    }
32762 
32763    /**
32764     *  Transform a star's ICRS catalog entry (epoch J2000.0) into ICRS
32765     *  astrometric place.
32766     *
32767     *  This function is part of the International Astronomical Union's
32768     *  SOFA (Standards of Fundamental Astronomy) software collection.
32769     *
32770     *  Status:  support function.
32771     *
32772     * <!-- Given: -->
32773     *  @param   rc     double   ICRS right ascension at J2000.0 (radians, Note 1)
32774     *  @param   dc     double   ICRS declination at J2000.0 (radians, Note 1)
32775     *  @param   pr     double   RA proper motion (radians/year, Note 2)
32776     *  @param   pd     double   Dec proper motion (radians/year)
32777     *  @param   px     double   parallax (arcsec)
32778     *  @param   rv     double   radial velocity (km/s, +ve if receding)
32779     *  @param   date1  double   TDB as a 2-part...
32780     *  @param   date2  double   ...Julian Date (Note 3)
32781     *
32782     * <!-- Returned:-->
32783     *  @return   ra,da  double*  ICRS astrometric RA,Dec (radians)
32784     *
32785     *  <p>Notes:
32786     *  <ol>
32787     *  <li> Star data for an epoch other than J2000.0 (for example from the
32788     *     Hipparcos catalog, which has an epoch of J1991.25) will require a
32789     *     preliminary call to iauPmsafe before use.
32790     *
32791     *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
32792     *
32793     *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
32794     *     convenient way between the two arguments.  For example,
32795     *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
32796     *     others:
32797     *
32798     *            date1          date2
32799     *
32800     *         2450123.7           0.0       (JD method)
32801     *         2451545.0       -1421.3       (J2000 method)
32802     *         2400000.5       50123.2       (MJD method)
32803     *         2450123.5           0.2       (date &amp; time method)
32804     *
32805     *     The JD method is the most natural and convenient to use in cases
32806     *     where the loss of several decimal digits of resolution is
32807     *     acceptable.  The J2000 method is best matched to the way the
32808     *     argument is handled internally and will deliver the optimum
32809     *     resolution.  The MJD method and the date &amp; time methods are both
32810     *     good compromises between resolution and convenience.  For most
32811     *     applications of this function the choice will not be at all
32812     *     critical.
32813     *
32814     *     TT can be used instead of TDB without any significant impact on
32815     *     accuracy.
32816     * </ol>
32817     *  Called:
32818     *     iauApci13    astrometry parameters, ICRS-CIRS, 2013
32819     *     iauAtccq     quick catalog ICRS to astrometric
32820     *
32821     *  @version  2021 April 18
32822     *
32823     *  @since SOFA release 2021-05-12
32824     *
32825     * <!--  Copyright (C) 2021 IAU SOFA Board.  See notes at end. -->
32826     */
32827    public static SphericalCoordinate jauAtcc13(double rc, double dc,
32828            double pr, double pd, double px, double rv,
32829            double date1, double date2)
32830    {
32831        /* Star-independent astrometry parameters */
32832        Astrom astrom = new Astrom();
32833 
32834        /* The transformation parameters. */
32835        jauApci13(date1, date2, astrom);
32836 
32837        /* Catalog ICRS (epoch J2000.0) to astrometric. */
32838        return jauAtccq(rc, dc, pr, pd, px, rv, astrom);
32839 
32840        /* Finished. */
32841    }
32842 
32843    /**
32844     *  Quick transformation of a star's ICRS catalog entry (epoch J2000.0)
32845     *  into ICRS astrometric place, given precomputed star-independent
32846     *  astrometry parameters.
32847     *
32848     *  Use of this function is appropriate when efficiency is important and
32849     *  where many star positions are to be transformed for one date.  The
32850     *  star-independent parameters can be obtained by calling one of the
32851     *  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
32852     *
32853     *  If the parallax and proper motions are zero the transformation has
32854     *  no effect.
32855     *
32856     *  This function is part of the International Astronomical Union's
32857     *  SOFA (Standards of Fundamental Astronomy) software collection.
32858     *
32859     *  Status:  support function.
32860     *
32861     * <!-- Given: -->
32862     *  @param   rc  double     ICRS RA at J2000.0 (radians)
32863     *  @param   dc  double     ICRS Dec at J2000.0 (radians)
32864     *  @param   pr     double     RA proper motion (radians/year, Note 3)
32865     *  @param   pd     double     Dec proper motion (radians/year)
32866     *  @param   px     double     parallax (arcsec)
32867     *  @param   rv     double     radial velocity (km/s, +ve if receding)
32868     *  @param   astrom Astrom star-independent astrometry parameters:
32869     *
32870     *  <!-- Returned: -->
32871     *   @return  ra,da  SphericalCoordinate    ICRS astrometric RA,Dec (radians)
32872     *
32873     *  <p>Notes:
32874     *  <ol>
32875     *  <li> All the vectors are with respect to BCRS axes.
32876     *
32877     *  <li> Star data for an epoch other than J2000.0 (for example from the
32878     *     Hipparcos catalog, which has an epoch of J1991.25) will require a
32879     *     preliminary call to iauPmsafe before use.
32880     *
32881     *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
32882     *</ol>
32883     *  Called:
32884     *     iauPmpx      proper motion and parallax
32885     *     iauC2s       p-vector to spherical
32886     *     iauAnp       normalize angle into range 0 to 2pi
32887     *
32888     *  @version  2021 April 18
32889     *
32890     *  @since SOFA release 2021-05-12
32891     *
32892     *  <!-- Copyright (C) 2021 IAU SOFA Board.  See notes at end. -->
32893     */
32894    public static SphericalCoordinate jauAtccq(double rc, double dc,
32895            double pr, double pd, double px, double rv,
32896            Astrom astrom)
32897    {
32898        double p[];
32899 
32900 
32901        /* Proper motion and parallax, giving BCRS coordinate direction. */
32902        p = jauPmpx(rc, dc, pr, pd, px, rv, astrom.pmt, astrom.eb);
32903 
32904        /* ICRS astrometric RA,Dec. */
32905        SphericalCoordinate co = jauC2s(p);
32906        co.alpha = jauAnp(co.alpha);
32907        return co;
32908 
32909        /* Finished. */
32910    }
32911 
32912 } // end of JSOFA Class
32913 
32914 /*
32915  * Copyright © 2021 Paul Harrison, University of Manchester.
32916  * 
32917  * This JSOFA software is derived from the official C release of the "Standards Of Fundamental Astronomy" (SOFA) library 
32918  * of the International Astronomical Union. The intention is to reproduce the functionality and algorithms of 
32919  * the official SOFA library in a pure Java form.
32920  * 
32921  * The responsibility for the maintenance and supply of the JSOFA library lies with the author (not the IAU SOFA Board), 
32922  * However, The JSOFA software is provided "as is" and the author makes no warranty as to its use or performance. 
32923  * The author does not and cannot warrant the performance or results which the user may obtain by using the JSOFA software. 
32924  * The author makes no warranties, express or implied, as to non-infringement of third party rights, merchantability,
32925  * or fitness for any particular purpose. In no event will the author be liable to the user for any consequential, 
32926  * incidental, or special damages, including any lost profits or lost savings, even if the author has been advised
32927  * of such damages, or for any claim by any third party.
32928  * 
32929  * Other conditions of the original license (reproduced below) are carried over as applicable.
32930  */
32931 
32932 /*----------------------------------------------------------------------
32933 *
32934 *  Copyright (C) 2021
32935 *  Standards Of Fundamental Astronomy Board
32936 *  of the International Astronomical Union.
32937 *
32938 *  =====================
32939 *  SOFA Software License
32940 *  =====================
32941 *
32942 *  NOTICE TO USER:
32943 *
32944 *  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
32945 *  CONDITIONS WHICH APPLY TO ITS USE.
32946 *
32947 *  1. The Software is owned by the IAU SOFA Board ("SOFA").
32948 *
32949 *  2. Permission is granted to anyone to use the SOFA software for any
32950 *     purpose, including commercial applications, free of charge and
32951 *     without payment of royalties, subject to the conditions and
32952 *     restrictions listed below.
32953 *
32954 *  3. You (the user) may copy and distribute SOFA source code to others,
32955 *     and use and adapt its code and algorithms in your own software,
32956 *     on a world-wide, royalty-free basis.  That portion of your
32957 *     distribution that does not consist of intact and unchanged copies
32958 *     of SOFA source code files is a "derived work" that must comply
32959 *     with the following requirements:
32960 *
32961 *     a) Your work shall be marked or carry a statement that it
32962 *        (i) uses routines and computations derived by you from
32963 *        software provided by SOFA under license to you; and
32964 *        (ii) does not itself constitute software provided by and/or
32965 *        endorsed by SOFA.
32966 *
32967 *     b) The source code of your derived work must contain descriptions
32968 *        of how the derived work is based upon, contains and/or differs
32969 *        from the original SOFA software.
32970 *
32971 *     c) The names of all routines in your derived work shall not
32972 *        include the prefix "iau" or "sofa" or trivial modifications
32973 *        thereof such as changes of case.
32974 *
32975 *     d) The origin of the SOFA components of your derived work must
32976 *        not be misrepresented;  you must not claim that you wrote the
32977 *        original software, nor file a patent application for SOFA
32978 *        software or algorithms embedded in the SOFA software.
32979 *
32980 *     e) These requirements must be reproduced intact in any source
32981 *        distribution and shall apply to anyone to whom you have
32982 *        granted a further right to modify the source code of your
32983 *        derived work.
32984 *
32985 *     Note that, as originally distributed, the SOFA software is
32986 *     intended to be a definitive implementation of the IAU standards,
32987 *     and consequently third-party modifications are discouraged.  All
32988 *     variations, no matter how minor, must be explicitly marked as
32989 *     such, as explained above.
32990 *
32991 *  4. You shall not cause the SOFA software to be brought into
32992 *     disrepute, either by misuse, or use for inappropriate tasks, or
32993 *     by inappropriate modification.
32994 *
32995 *  5. The SOFA software is provided "as is" and SOFA makes no warranty
32996 *     as to its use or performance.   SOFA does not and cannot warrant
32997 *     the performance or results which the user may obtain by using the
32998 *     SOFA software.  SOFA makes no warranties, express or implied, as
32999 *     to non-infringement of third party rights, merchantability, or
33000 *     fitness for any particular purpose.  In no event will SOFA be
33001 *     liable to the user for any consequential, incidental, or special
33002 *     damages, including any lost profits or lost savings, even if a
33003 *     SOFA representative has been advised of such damages, or for any
33004 *     claim by any third party.
33005 *
33006 *  6. The provision of any version of the SOFA software under the terms
33007 *     and conditions specified herein does not imply that future
33008 *     versions will also be made available under the same terms and
33009 *     conditions.
33010 *
33011 *  In any published work or commercial product which uses the SOFA
33012 *  software directly, acknowledgement (see www.iausofa.org) is
33013 *  appreciated.
33014 *
33015 *  Correspondence concerning SOFA software should be addressed as
33016 *  follows:
33017 *
33018 *      By email:  sofa@ukho.gov.uk
33019 *      By post:   IAU SOFA Center
33020 *                 HM Nautical Almanac Office
33021 *                 UK Hydrographic Office
33022 *                 Admiralty Way, Taunton
33023 *                 Somerset, TA1 2DN
33024 *                 United Kingdom
33025 *
33026 *--------------------------------------------------------------------*/
33027 
33028 
33029 /*
33030  * $Log$
33031  */